Shannon Diversity Index (H′)

Also known as Shannon index · Shannon-Wiener index · Shannon-Weaver index · H prime · species diversity index · ecological entropy · Shannon entropy of a community · diversity index

H=ipilnpiH' = -\sum_{i} p_i \ln p_i

Enter your known values, leave one input blank, and solves for the missing one. Try different units for next level excitement!

Learning zone

This page and Shannon entropy of a binary source are the same equation. Not an analogy, not a cousin — the same equation, sitting in two different shelves of this catalog because two different professions found it useful. Claude Shannon published −Σ p log p in 1948 in A Mathematical Theory of Communication, working at Bell Labs on how much information a telephone line could carry. Within a decade ecologists had lifted it wholesale, put species where the symbols had been, and started calling it the Shannon-Wiener index. The quantity did not change. A message drawn from an alphabet where one letter dominates is predictable and carries little information per symbol; a community where one species dominates is predictable and scores low diversity. Diversity and information content are one measurement performed on different alphabets, and a catalog can say that out loud where a textbook, filed by discipline, usually cannot.

The only real difference is the base of the logarithm. Shannon used log base 2 and got bits, because a bit is a yes-or-no decision and that is what a channel carries. Ecology settled on the natural log and gets nats, which is why this page reports 1.2799 for a community of four species at 0.4, 0.3, 0.2 and 0.1 while a spreadsheet set to log base 2 reports 1.8464 for the same community. Both are correct; they differ by ln 2 = 0.6931. Some ecology papers still use base 10. Always check which, because H′ is a bare number with no unit to give the game away.

Two things this page cannot do for you. It takes exactly four species, because a solver has a fixed list of input boxes and a sum has no fixed length — enter 0 in a slot you do not need and it drops out of the sum, since p ln p tends to zero as p tends to zero. And it does not normalise. The four proportions must add to 1, because the reveal step shows the numbers you typed substituted into the formula, and a page that silently divided by your total would print "40 ln 40" and call it an entropy. If you are holding a count table — 40, 30, 20 and 10 individuals — divide each by the total of 100 first.

The honest limitation is bigger than either. An H′ of 2.4 means nothing on its own. Diversity indices are not comparable between studies unless the sampling effort and the taxonomic level match. Rare species are the ones you miss when you sample less, and they are exactly the ones the logarithm weights most generously, so a smaller sample of the same forest reliably reports a smaller H′. Compare beetles to beetles, quadrat to quadrat, season to season — or convert to effective species numbers, exp(H′), which at least behaves sensibly when you combine communities.

Shannon Diversity Index (H′)
H=ipilnpiH' = -\sum_{i} p_i \ln p_i
p1p2p3p4shareH′−Σ p ln prank abundance
Where
  • HH'= Shannon diversity index
  • p1p_1= Proportion of species 1
  • p2p_2= Proportion of species 2
  • p3p_3= Proportion of species 3
  • p4p_4= Proportion of species 4