Advertisement

Shannon diversity index calculator

The Shannon index measures how uncertain you would be about the identity of a randomly picked individual. Enter the count of each species, separated by commas, and the calculator returns the index, its evenness, the richness and the Simpson index.

Calculator

Separate counts with commas, spaces or new lines. Species with a count of zero are ignored.

Shannon diversity index H
1.0297
Pielou evenness J
0.9372
Species richness S
3
Simpson index D (sum of squared proportions)
0.3800
Total individuals
100
What this means
With 3 species and 100 individuals, H is 1.030 and evenness is 94 percent of the maximum. A community with the same richness but perfectly even counts would give H = 1.099. A lower Simpson index means a higher chance that two randomly picked individuals belong to different species.
Species counts and contributions
SpeciesCountProportion pContribution to H (-p ln p)
Species 150.00000.50000.3466
Species 230.00000.30000.3612
Species 320.00000.20000.3219
Rank abundance curve Line chart. The data table follows. 0 0 0.75 0.125 1.5 0.25 2.25 0.375 3 0.5 Rank Proportion
Rank abundance curve data
SeriesRankProportion
Rank abundance10.5
Rank abundance20.3
Rank abundance30.2

Advertisement

How this calculator works

The Shannon index, borrowed from information theory, takes the proportion of each species and multiplies it by its logarithm, then adds the results and changes the sign. When one species dominates, almost every individual belongs to it, the uncertainty is low, and H is close to zero. When many species are equally common, the uncertainty is high and H approaches the logarithm of the number of species. The choice of logarithm base only rescales the number: natural logs give nats, base 2 gives bits and base 10 gives hartleys, and all three rank communities the same way. Pielou evenness divides H by its maximum for the same richness, so it runs from zero to one and measures how evenly the individuals are spread across species. The Simpson index is a different summary: it gives the probability that two individuals picked at random belong to the same species, so a lower value means more diversity. Species with a count of zero are not included in richness.

Formula

p = count / total for each species. H = -sum(p x ln p) / ln(base). J = H / (ln(S) / ln(base)), where S is the number of species present. Simpson index D = sum(p^2). The rank abundance curve plots the proportions in descending order.

Worked example

Counts of 50, 30 and 20 give a total of 100 and proportions of 0.5, 0.3 and 0.2. The natural-log contributions are 0.3466, 0.3612 and 0.3219, which add to H = 1.0297 nats. With three species the maximum is ln 3 = 1.0986, so evenness is 1.0297 / 1.0986 = 0.937. Simpson D is 0.25 + 0.09 + 0.04 = 0.38.

Advertisement

Frequently asked questions

Which index should I use, Shannon or Simpson?

Shannon gives more weight to rare species and Simpson more weight to common ones, so Shannon is more sensitive to species that appear in small numbers. Many studies report both. If the ranking of sites matters, the two usually agree; if it does not, the choice is part of your result.

Do I need counts or can I use biomass?

Both work, but the answer means different things. Counts describe the diversity of individuals, while biomass or cover describes the diversity of the material present. Do not mix the two in one dataset.

Should zero counts be included?

No. A species with zero individuals was not observed and adds nothing to the proportions. Excluding it is why richness here is the number of species present, not the number of species you typed.

Is the result comparable between studies?

Only if the sampling effort and area are similar. A larger sample finds more rare species, which raises both richness and H. Rarefaction, which standardises the sample size, is the usual fix.

Sources

Advertisement