Measure the biodiversity of a sample from species counts: Shannon's H′, Pielou's evenness, the effective number of species, and Simpson's index alongside for comparison.
H′ = −Σ pᵢ ln pᵢ
One species per line as “name: count”, or just a list of counts.
The Shannon diversity index, H′, measures how diverse a community is by combining how many species there are (richness) with how evenly individuals are spread among them (evenness). It rises when there are more species and when no single species dominates.
It's Shannon's information entropy applied to species: the uncertainty about which species the next individual you find will be. In a monoculture you always know; in a rich, balanced meadow you rarely do.
H′ itself has awkward units. Two conversions help. Evenness (J′) rescales it from 0 to 1. The effective number of species (e^H′) tells you how many equally common species would give the same diversity.
As given in Magurran, Measuring Biological Diversity, chapter 4, Pielou (1966) and Jost (2006). See Sources.
Simpson's 1 − D is the chance two individuals picked at random belong to different species. It's less sensitive to rare species than H′.
Both meadows have the same species list, but B is dominated by one plant. In effective-species terms A behaves like 3.6 equally common species and B like only 1.8, a comparison H′ alone (1.28 vs 0.59) doesn't make obvious.
Five communities of 100 individuals.
| Community | H′ | J′ | Effective species | 1 − D |
|---|---|---|---|---|
| 100 | 0 | — | 1 | 0 |
| 50, 50 | 0.693 | 1 | 2 | 0.505 |
| 85, 5, 5, 5 | 0.588 | 0.424 | 1.8 | 0.273 |
| 40, 30, 20, 10 | 1.28 | 0.923 | 3.6 | 0.707 |
| 25 × 4 | 1.386 | 1 | 4 | 0.758 |
| 10 × 10 | 2.303 | 1 | 10 | 0.909 |
Real communities usually fall between about 1.5 and 3.5. The maximum possible is ln S, the natural log of the number of species.
How evenly individuals are spread: 1 means all species are equally common, values near 0 mean one species dominates.
e^H′: the number of equally common species that would give the same Shannon index. It behaves intuitively: doubling it means twice as diverse.
Shannon is more sensitive to rare species; Simpson is dominated by the common ones. Reporting both is common.
They contribute nothing to H′ and aren’t counted in S, because they weren’t observed in the sample.
Yes, with natural logs. The Shannon entropy calculator gives the same value in nats.
Hutcheson’s t-test compares two H′ values, using their variances; it needs the raw counts.
Historical mix-up: it’s Shannon’s 1948 formula, sometimes credited to Wiener too. Shannon–Weaver is another variant name.
Related Tools