Biodiversity Index Calculator: Shannon and Simpson Diversity
By FindMySum · Last reviewed
A biodiversity index puts a number on how varied a community of living things is. Counting species is the first step, but two meadows with the same ten species can be very different: in one, every species is common; in the other, a single grass makes up nine plants in ten. Diversity indices combine the number of species (richness) with how evenly the individuals are spread among them (evenness). This calculator works out the two most widely used, the Shannon index and Simpson's index, from a list of species and counts, along with the evenness, the effective number of species and the dominance of the commonest species.
Entering your counts
Type one species per line followed by its count, such as "Red oak 18", or just the counts separated by commas if the names don't matter. Counts must be whole numbers: individuals of each species in your plot, transect, net haul or trap. A species with a count of 0 is left out of the richness. Every index is calculated from the proportions pᵢ = nᵢ ÷ N, where N is the total number of individuals.
The Shannon diversity index
The Shannon index H′ = −Σ pᵢ ln pᵢ measures how uncertain you would be about the species of the next individual you sample. With only one species there is no uncertainty and H′ = 0. With S species that are all equally common, H′ reaches its maximum, ln S. Real communities sit in between, usually between about 1.5 and 3.5 with natural logs.
Because the maximum depends on the number of species, H′ is often divided by ln S to give Pielou's evenness J′, from 0 (one species dominates completely) to 1 (all are equally common). The Shannon index gives rare species more weight than Simpson's does, so it rises noticeably when a sample turns up a few extra species seen only once.
Simpson's index
Simpson's D = Σ nᵢ(nᵢ − 1) ÷ (N(N − 1)) is the probability that two individuals picked at random, without putting the first back, are of the same species. It is a measure of dominance: high when one species is common. The calculator reports it with its two common transformations, the index of diversity 1 − D (the chance the two are different species) and the reciprocal 1/D. Simpson's index changes little when a rare species is added, which makes it more stable than Shannon's between small samples.
Effective number of species
Indices in different units are hard to compare, and their scale is not linear: doubling the diversity of a community does not double its H′. The effective number of species (Hill numbers, popularised for ecologists by Lou Jost in 2006) fixes that. It is the number of equally common species that would give the same index: exp(H′) for Shannon and 1/Σpᵢ² for Simpson. A value of 4.9 means "as diverse as 4.9 species of equal abundance", whatever the actual species count.
Worked example: a woodlot tree survey
The calculator opens on a survey of 70 trees in a mixed hardwood woodlot: 25 sugar maple, 18 red oak, 12 white birch, 8 eastern hemlock, 4 white ash, 2 black cherry and 1 basswood.
- Proportions: sugar maple 25 ÷ 70 = 0.357, red oak 0.257, white birch 0.171, hemlock 0.114, ash 0.057, cherry 0.029, basswood 0.014.
- Shannon: adding −p ln p for each species gives H′ = 1.593. The maximum for 7 species is ln 7 = 1.946, so the evenness J′ = 0.819.
- Simpson: (25 × 24 + 18 × 17 + 12 × 11 + 8 × 7 + 4 × 3 + 2 × 1 + 1 × 0) ÷ (70 × 69) = 1,108 ÷ 4,830 = 0.2294. The index of diversity 1 − D is 0.771 and 1/D is 4.36.
- Effective species: exp(1.593) = 4.92. Seven species were found, but the woodlot is as diverse as about five equally common ones, because sugar maple and red oak make up 61% of the trees.
- Berger–Parker dominance: the commonest species, sugar maple, is 35.7% of the sample.
Getting comparable numbers
Diversity indices depend on how hard you looked. A bigger sample finds more rare species, which raises richness and Shannon's H′ more than Simpson's index. When you compare sites or years, keep the method the same: the same plot size, the same number of traps or minutes of searching, the same season and the same level of identification. If a species could only be identified to genus, count the genus as one "species" everywhere. A species accumulation curve (species found against individuals counted) shows whether you have sampled enough: when it flattens, extra effort adds few new species.
These indices describe diversity within one sample, called alpha diversity. Comparing which species two sites share (beta diversity) needs similarity measures such as Jaccard or Bray–Curtis, and correcting for species you missed needs estimators such as Chao1. Those are not part of this calculator.
More questions
Is the Shannon index the same as the Shannon–Wiener or Shannon–Weaver index?
Yes. The formula comes from Claude Shannon's 1948 paper on information theory; ecologists have called it the Shannon–Wiener and Shannon–Weaver index after other authors connected with it. All three names mean H′ = −Σ pᵢ ln pᵢ, although some older papers use base 2 or base 10, so check the base before comparing values.
Why do two papers report different Simpson values for the same data?
Because Simpson's name covers several numbers. D (or λ) is the probability that two individuals are the same species, which falls as diversity rises; 1 − D is the probability they differ; 1/D is the inverse. Some authors also use Σpᵢ² (sampling with replacement) instead of Σnᵢ(nᵢ − 1)/(N(N − 1)). For large samples the two forms are almost equal.
Can a diversity index tell me whether a habitat is healthy?
Not on its own. A disturbed site can gain weedy or invasive species and score higher than an intact one. Indices are best for comparing the same kind of habitat sampled the same way, over time or between sites, alongside which species are present: native, at risk, or indicators of water or soil quality.
What is species richness and why is it not enough?
Richness S is the number of species found. It ignores abundance: a pond with one common fish and nine species seen once has the same richness as a pond where all ten are equally common. Shannon and Simpson indices combine richness with evenness, so they separate those two ponds.
How do I compare two sites with the calculator?
Enter the first site's counts and save it as a scenario, then enter the second. Scenario compare shows both sets of indices side by side. The effective number of species is the clearest comparison: a site with 8 effective species is twice as diverse as one with 4, which H′ values of 2.08 and 1.39 do not make obvious.
Sources
This article explains how the calculator works and is general information, not financial, tax, legal or medical advice. Rules change; check the sources above or a qualified professional before you act.