StatGardenREF. DESK
Calculators/Ecology/Shannon diversity index
Ecology

Shannon diversity index calculator

Biodiversity of a community from species counts.

Published 9 August 2026 · Updated 24 September 2026

What this calculator does

Counting species tells you how many there are but not how the community is shaped. A wood with four species split evenly is more diverse in any useful sense than one where a single species makes up 97% of the individuals, even though both have a richness of four. The Shannon index combines both facts into one number.

It does that by weighting each species by how surprising it is to encounter. A rare species contributes little because it is rarely met; a dominant one contributes little because meeting it tells you nothing. The index peaks when every species is equally abundant, at which point it equals the natural logarithm of the species count.

The formula

FormulaH′ = −Σ(pᵢ·ln pᵢ), pᵢ = nᵢ/N; Evenness = H′/ln(S)

Each species count is divided by the total to give its proportion p. The index is the negative sum of each p multiplied by its own natural logarithm, which is a quantity borrowed from information theory where it measures uncertainty. Evenness divides that index by ln(S), the maximum it could reach for that number of species, giving a figure from 0 to 1 that describes the balance alone.

TermMeaning
H′The Shannon index itself. Higher means more diverse, with no fixed upper bound since it rises with species count.
pᵢThe proportion of the community made up by species i.
EvennessH′ divided by ln(S), from 0 for total dominance to 1 for a perfectly even community.
Richness (S)The plain count of species present, ignoring how common each one is.

The inputs explained

FieldWhat to enter
Individuals per species (comma-separated)The number of individuals of each species, separated by commas. Order does not matter, and a species with zero individuals should be left out rather than entered as 0.

When to use it

Comparing two sites

Two surveys with the same species count can differ greatly in how evenly the individuals are spread, and the index picks that up where a richness count does not.

Tracking a site over time

A falling index with unchanged richness usually means one species is coming to dominate, which is often the earliest measurable sign of a disturbance.

Reporting a standard biodiversity figure

Shannon is the most widely reported diversity index in ecology, so it is usually the one expected in a survey report even where another measure might suit the data better.

Worked examples

Every figure in the tables below is produced by this page’s own calculator at build time, so the numbers and the tool always agree. Select any row to load that scenario.

How does dominance change the Shannon index?

Four communities that all have four species and one hundred individuals, differing only in how evenly those individuals are spread.

Four species, 100 individuals, differently distributed
Species countsShannon index H′EvennessSpecies richness S
25, 25, 25, 251.3861.0004
45, 38, 12, 51.1310.8164
90, 5, 3, 20.4280.3094
97, 1, 1, 10.1680.1214
Richness is 4 in every row and the index still falls from 1.386 to 0.168. The first row is perfectly even and reaches the maximum possible for four species, which is ln(4) = 1.386, with an evenness of exactly 1.000. The last row has the same four species but one of them holds 97 of the 100 individuals, and the index collapses to about an eighth of the maximum.

Questions

What is a good Shannon index value?

There is no universal threshold. Values typically fall between about 1.5 and 3.5 in ecological surveys, but the figure depends on the sampling effort and the kind of community, so it is only meaningful compared against another survey done the same way. Comparing an index across different methods or sample sizes is not valid.

Should I use Shannon or Simpson?

Shannon is more sensitive to rare species, Simpson to dominant ones. If the question is whether uncommon species are being lost, Shannon responds sooner. If it is whether one species is taking over, Simpson is the more direct measure. Reporting both is common and costs nothing.

Does the index use natural log or log base 2?

This calculator uses natural log, which is the most common convention in ecology and gives the maximum as ln(S). Log base 2 is used in information theory and gives values about 1.44 times larger. The choice does not change any ranking, but it does change the numbers, so state which was used.

What does an evenness of 1 mean?

Every species has exactly the same number of individuals, which is the most balanced a community can be and the maximum the index can reach for that richness. Real communities essentially never reach it; most natural assemblages have a few common species and a long tail of rare ones.

For the trunk-area measure of how dense a stand of trees is, see the tree basal area calculator. For population growth under a fixed ceiling, see the logistic growth calculator.