This calculator measures how evenly individuals are spread across four species. Enter the count of each species; you get the Shannon diversity index H, Pielou’s evenness J (0 to 1) and the Simpson diversity 1 − D.
Formula
With pᵢ = countᵢ ÷ total: Shannon H = −Σ pᵢ ln pᵢ. Evenness J = H ÷ ln S, where S is the number of species (4 here), so J = 1 means all species are equally common. Simpson diversity = 1 − Σ pᵢ².
- a, b, c, d: individuals counted of each species
- ln: natural logarithm
Worked Example
Counts 40, 30, 20, 10 (total 100).
- p = 0.4, 0.3, 0.2, 0.1
- p ln p = −0.3665, −0.3612, −0.3219, −0.2303; H = 1.2799
- ln 4 = 1.3863; J = 1.2799 ÷ 1.3863 = 0.9232
- Σp² = 0.16 + 0.09 + 0.04 + 0.01 = 0.30; 1 − D = 0.7000
Limits and common mistakes
- Every count must be at least 1: a species with 0 individuals is not present, so count fewer species (ln 0 cannot be computed).
- H depends on the log base; this page uses the natural log (some texts use log₂, giving bits).
- Evenness from small samples is noisy; count enough individuals.
Formula used
in a | Species 1 count | - | 40 | 1 in b | Species 2 count | - | 30 | 1 in c | Species 3 count | - | 20 | 1 in d | Species 4 count | - | 10 | 1 out h | Shannon index H | - | -((a/(a+b+c+d))*ln(a/(a+b+c+d)) + (b/(a+b+c+d))*ln(b/(a+b+c+d)) + (c/(a+b+c+d))*ln(c/(a+b+c+d)) + (d/(a+b+c+d))*ln(d/(a+b+c+d))) | 4 out j | Pielou evenness J | - | h / ln(4) | 4 out si | Simpson diversity 1 − D | - | 1 - ((a/(a+b+c+d))^2 + (b/(a+b+c+d))^2 + (c/(a+b+c+d))^2 + (d/(a+b+c+d))^2) | 4 out nt | Total individuals | - | a + b + c + d | 0
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.
More cards in this drawer
- AMU to MeV Calculator (Mass-Energy Equivalent)931.494 MeV
- Number of Moles Calculator (from Mass)0.171116 mol