MapBees logoMapBees

Blog

How even: the Shannon diversity index, explained simply

Is the food scene here balanced, or is it one cuisine with a few token exceptions? 'How even' (Shannon evenness) answers exactly that, on a 0-1 scale. Here is the formula, and how it differs from 'How mixed', with six cuisines across London.

Formula seriesBeginner friendlyLondon example
ByTinkal Gogoi(LinkedIn profile, opens in a new tab)September 9, 2026Updated October 21, 20268 min read

Is the mix balanced, or one thing with exceptions?

A street with twenty Italian restaurants and one each of five other cuisines has six kinds. So does a street with a fair spread of all six. Counting kinds says both have six; counting restaurants says both have twenty-five. Neither number sees the difference, and the difference is the whole story.

How even is the number for that. It asks whether the kinds present get a fair slice each, or whether one of them dominates. The field calls it Shannon entropy - borrowed from information theory, where it measures how unpredictable a message is. A perfectly even food scene is maximally unpredictable: you cannot guess the cuisine of the next restaurant. A one-cuisine street is perfectly predictable. MapBees scales it to 0-1 so any set of kinds reads the same way - which is why the app's badge calls it Shannon evenness - and works it out for every hex - one hexagon on the map, about 350 m across (roughly 0.1 km²).

How eventhe field's term: Shannon evenness

How even six cuisines are within a 10-minute walk. Yellow hexes spread their restaurants fairly across Italian, Indian, Chinese, Thai, Mexican and Lebanese; purple ones are dominated by one.

Switching it on

Exactly as for “How mixed”: open the Map type picker, choose Variety, then tick the kinds you want compared. The Measure as row offers both indices, and a third reading besides.

Where to click

  1. Map type
  2. Variety
  3. Tick 6 cuisines
  4. Measure as: How even
The same six cuisines, measured as 'How even'. Everything else in the panel is unchanged - the same 17,222 hexes have an answer - only the question asked of the set is different.
'Measure as' set to How even. Flip it to How mixed and watch which hexes move - that is the difference between the two formulas, drawn.

The row has a third answer, How many kinds, and it ignores shares altogether: it counts how many of the kinds are within a 10-minute walk at all. The two streets above are 6 of 6 alike, which is exactly the difference How even exists to see - and exactly right when the question is whether you can do your errands on foot. The How many kinds post covers that reading.

Reading the map

The ends read 'One kind dominates' and 'Evenly mixed'. Different words from the Simpson legend on purpose: this index is about evenness, and its labels say so.
Hovering near Greenwich gives 0.79; at the same place the How mixed map reads 0.70. 1 would be a perfectly even split across all six cuisines.

The math, honestly

For each kind, multiply its share by the natural log of its share, add those up, and flip the sign. Then divide by the log of the number of kinds you picked, so the result is 0-1 whether you picked four kinds or fourteen. That last division is the part that makes two sets comparable, and it is why the app calls the result normalized.

Two streets, four cuisines each
Street A - one cuisine at 92.5%, three at 2.5%
−Σ p·ln p = 0.35
Divided by ln(4) = 1.386
0.35 ÷ 1.386
Street A - How even
0.25
Street B - four cuisines at 25% each
−Σ p·ln p = 1.386
Street B - How even
1.386 ÷ 1.386 = 1.00

Compare the Simpson results for the same two streets: 0.14 and 0.75. Both agree A is a monoculture and B is varied; Shannon just uses the full 0-1 range and comes down harder on the dominant kind.

Use 'How even' when balance is the point

A food street, a market hall, a mixed-use high street: settings whose value is that no single kind takes over. Shannon is the stricter judge of that.

Use 'How mixed' when monoculture is the worry

If what you want to avoid is 'all one thing' and a few rare kinds are fine, Simpson's random-pair question matches the way you are thinking.

Both need something to measure

A hex with none of the six cuisines within reach has no evenness to report, so it shows as “no data” rather than 0. And because a variety index is already a proportion, the Variety map offers no “Count as” row at all - there is no such thing as evenness per resident.

See how even London's cuisines are

The whole idea, in five lines

  • How even = −Σ share × ln(share), divided by ln(number of kinds). That is normalized Shannon entropy, on a 0-1 scale.
  • 1 is a perfectly fair split across every kind you picked; 0 is a single kind. A dominant kind pulls it down hard.
  • It needs a set of two or more kinds, read over a walk so each hex has enough places to judge.
  • The legend reads 'One kind dominates' to 'Evenly mixed', and hexes with none of the kinds show no data rather than 0.
  • Flip 'Measure as' between How even and How mixed to see where the two formulas disagree; How many kinds is its third reading.

The companion post, How mixed, runs the same six cuisines through the Simpson index.

Quick questions

What does the Shannon index measure?

How evenly the kinds in a hex are spread. MapBees scales it to 0-1: 0 means a single kind, 1 means a perfectly even split across every kind you picked. The app calls it 'How even', with 'Shannon evenness' as the field's term on its badge.

Are How mixed and How even the only choices under 'Measure as'?

No. There is a third, How many kinds, which ignores shares and counts how many of the kinds are within reach at all - the reading behind the ready-made question Everyday needs.

How is 'How even' different from 'How mixed'?

'How mixed' (Simpson) asks how likely two random picks differ; 'How even' (Shannon) asks whether every kind gets a fair slice. Shannon reacts more strongly to one dominant kind, so it is the stricter of the two.

Why is the index divided by ln(K)?

Raw Shannon entropy grows with the number of kinds, so six cuisines could never be compared with four. Dividing by ln(K), where K is the number of kinds you picked, puts every set's index on the same 0-1 scale.

What does the map show?

Each hex is colored from 'One kind dominates' through 'Somewhat even' to 'Evenly mixed'. Hexes with none of the kinds you picked show as having no data, because evenness needs something to be even.

Which should I use for choosing a location?

Use 'How even' when a balanced mix is the point - a food street, a market hall. Use 'How mixed' when you mainly want to avoid monocultures and do not mind a few rare kinds.

See it on a real map

The best way to understand the score is to play with it. The full app is on a Free Tier, with no sales call.

About the author

Tinkal Gogoi(LinkedIn profile, opens in a new tab)Founder & Location Data Engineer

Builds MapBees's location-intelligence pipeline end to end — census and Overture Maps ingestion, H3 hex scoring, and the map interface — and writes the methodology behind every number on the site.