Simpson’s Diversity Index Calculator
Simpson’s diversity index calculator for up to 12 species: 1 − Σ(n/N)², D, 1 − D and 1/D with working, Shannon’s H′, evenness and two habitats compared.
Calculator
- 1 − Σ(n/N)², Mixed wood The AP Biology equation sheet’s Diversity Index = 1 − Σ(n/N)²: the chance that two individuals picked at random, with replacement, belong to different species. It is 0 for a single species and rises towards 1.
- 0.7768
- 1 − Σ(n/N)², Birch wood The AP Biology equation sheet’s Diversity Index = 1 − Σ(n/N)²: the chance that two individuals picked at random, with replacement, belong to different species. It is 0 for a single species and rises towards 1.
- 0.348
- 1 − D, Mixed wood The unbiased form for a sample, 1 − Σn(n − 1) ÷ N(N − 1): the same chance picking without replacement. It is never below 1 − Σ(n/N)², because 1 − D = (1 − Σ(n/N)²) × N ÷ (N − 1).
- 0.7927
- 1 − D, Birch wood The unbiased form for a sample, 1 − Σn(n − 1) ÷ N(N − 1): the same chance picking without replacement. It is never below 1 − Σ(n/N)², because 1 − D = (1 − Σ(n/N)²) × N ÷ (N − 1).
- 0.3551
- 1/D, Mixed wood The reciprocal index, 1/D = N(N − 1) ÷ Σn(n − 1), which AQA calls the index of diversity, d. It is 1 for a single species and rises with diversity.
- 4.823
- 1/D, Birch wood The reciprocal index, 1/D = N(N − 1) ÷ Σn(n − 1), which AQA calls the index of diversity, d. It is 1 for a single species and rises with diversity.
- 1.551
Mixed wood is the more diverse of the two by both indices: 1 − Σ(n/N)² is 0.7768 against 0.348, and H′ is 1.549 against 0.7564.
| Index | Mixed wood | Birch wood |
|---|---|---|
| Individuals, N | 50 | 50 |
| Species present, S | 5 | 5 |
| Σ(n/N)² | 0.2232 | 0.652 |
| Diversity index, 1 − Σ(n/N)² | 0.7768 | 0.348 |
| 1/Σ(n/N)² | 4.48 | 1.534 |
| Σn(n − 1) | 508 | 1580 |
| N(N − 1) | 2450 | 2450 |
| Simpson’s index, D | 0.2073 | 0.6449 |
| Unbiased form, 1 − D | 0.7927 | 0.3551 |
| Reciprocal index, 1/D | 4.823 | 1.551 |
| Shannon’s H′, ln | 1.549 | 0.7564 |
| Pielou’s evenness, J′ | 0.9625 | 0.47 |
Each bar is a species’ share of its own habitat’s individuals, all drawn to one scale, with the count and percentage beside it. Bars of similar length mean an even habitat; one long bar means a habitat dominated by one species.
| Species | n | n(n − 1) | p = n/N | p² | −p ln p |
|---|---|---|---|---|---|
| Birch | 10 | 90 | 0.2 | 0.04 | 0.3219 |
| Oak | 15 | 210 | 0.3 | 0.09 | 0.3612 |
| Ash | 12 | 132 | 0.24 | 0.0576 | 0.3425 |
| Rowan | 8 | 56 | 0.16 | 0.0256 | 0.2932 |
| Holly | 5 | 20 | 0.1 | 0.01 | 0.2303 |
| Total | 50 | 508 | 1 | 0.2232 | 1.549 |
Working, Mixed wood
- S = 5 species
- N = 10 + 15 + 12 + 8 + 5 = 50
- Σn² = 10^2 + 15^2 + 12^2 + 8^2 + 5^2 = 100 + 225 + 144 + 64 + 25 = 558
- Σ(n/N)² = 558 / 50^2 = 0.2232
- 1 − Σ(n/N)² = 1 − 0.2232 = 0.7768
- 1/Σ(n/N)² = 50^2 / 558 = 4.4803
- Σn(n − 1) = 10 × 9 + 15 × 14 + 12 × 11 + 8 × 7 + 5 × 4 = 90 + 210 + 132 + 56 + 20 = 508
- N(N − 1) = 50 × 49 = 2450
- D = 508 / 2450 = 0.20735
- 1 − D = 1 − 0.20735 = 0.79265
- 1/D = 2450 / 508 = 4.8228
- H′ = −(0.2 × ln(0.2) + 0.3 × ln(0.3) + 0.24 × ln(0.24) + 0.16 × ln(0.16) + 0.1 × ln(0.1)) = 1.5491
- J′ = 1.5491 / ln(5) = 0.96248
The answer is 1 − Σ(n/N)², the form on the AP Biology equation sheet. Below it, n(n − 1) counts the ordered pairs of two different individuals of one species and N(N − 1) every such pair in the habitat, so D is the chance that a pair picked without replacement belongs to one species, and 1 − D is the unbiased form for a sample.
| Species | n | n(n − 1) | p = n/N | p² | −p ln p |
|---|---|---|---|---|---|
| Birch | 40 | 1560 | 0.8 | 0.64 | 0.1785 |
| Oak | 4 | 12 | 0.08 | 0.0064 | 0.2021 |
| Ash | 3 | 6 | 0.06 | 0.0036 | 0.1688 |
| Rowan | 2 | 2 | 0.04 | 0.0016 | 0.1288 |
| Holly | 1 | 0 | 0.02 | 0.0004 | 0.07824 |
| Total | 50 | 1580 | 1 | 0.652 | 0.7564 |
Working, Birch wood
- S = 5 species
- N = 40 + 4 + 3 + 2 + 1 = 50
- Σn² = 40^2 + 4^2 + 3^2 + 2^2 + 1^2 = 1600 + 16 + 9 + 4 + 1 = 1630
- Σ(n/N)² = 1630 / 50^2 = 0.652
- 1 − Σ(n/N)² = 1 − 0.652 = 0.348
- 1/Σ(n/N)² = 50^2 / 1630 = 1.5337
- Σn(n − 1) = 40 × 39 + 4 × 3 + 3 × 2 + 2 × 1 + 1 × 0 = 1560 + 12 + 6 + 2 + 0 = 1580
- N(N − 1) = 50 × 49 = 2450
- D = 1580 / 2450 = 0.6449
- 1 − D = 1 − 0.6449 = 0.3551
- 1/D = 2450 / 1580 = 1.5506
- H′ = −(0.8 × ln(0.8) + 0.08 × ln(0.08) + 0.06 × ln(0.06) + 0.04 × ln(0.04) + 0.02 × ln(0.02)) = 0.75637
- J′ = 0.75637 / ln(5) = 0.46996
The answer is 1 − Σ(n/N)², the form on the AP Biology equation sheet. Below it, n(n − 1) counts the ordered pairs of two different individuals of one species and N(N − 1) every such pair in the habitat, so D is the chance that a pair picked without replacement belongs to one species, and 1 − D is the unbiased form for a sample.
Cite this tool
Citing this tool
Last updated . Add the date you accessed it as well, which a citation of a page that can change asks for. If a specific result matters, cite the permalink from the tool’s share row instead of this page: it reproduces the exact parameters.
On the syllabus: AP Biology, Unit 8: Ecology.
The equation
AP Biology Equations and Formulas, College Board (2025); Simpson (1949), Measurement of diversity, Nature 163: 688; Chen, Wang and Shen (2023), Front. Plant Sci. 14: 1159090; Wikipedia, Diversity index; Shannon (1948)
The equation as an image to reuse
What is Simpson’s diversity index?
Simpson’s diversity index measures how varied a community is from a count of the individuals
of each species. The AP Biology equations and formulas sheet writes it as
Diversity Index = 1 − Σ(n/N)², where n is the number of individuals of one
species and N the total of all species: the chance that two individuals picked at random,
with replacement, belong to different species. It is 0 for a single species, rises towards 1
with diversity, and it is the result the calculator highlights. Picking without replacement
gives D = Σn(n − 1) ÷ N(N − 1), the chance of a same-species pair, and
1 − D, the unbiased form of the index for a sample, while the reciprocal index
1/D, which is 1 for a single species, rises with diversity.
The index rewards two things at once: more species, which is richness, and individuals spread more evenly among them, which is evenness. E. H. Simpson set it out in Nature in 1949, as a measure of concentration defined “in terms of population constants”. This calculator works out 1 − Σ(n/N)², D, 1 − D and 1/D for up to twelve species, with Shannon’s index and evenness, for one habitat or two side by side.
Using the calculator
Type a name and a count for each species, one row per species, and add rows up to twelve. Counts are whole numbers of individuals. With Compare a second habitat ticked, every row takes a second count, so both habitats share one species list and a species missing from one of them is entered as 0. Untick it to work with a single habitat.
The readouts lead with 1 − Σ(n/N)², highlighted, and the table beneath them lists every figure for each habitat, including the sums behind the indices. The bar chart draws each species’ share of its own habitat on one scale, which makes evenness visible: bars of similar length mean an even habitat. Below that, each habitat gets a species-by-species table of the columns an exam answer uses and its working, every division written out, with the 1 − Σ(n/N)² line marked as the answer. The link in the share row reopens the whole table.
Worked example: two woods with the same five species
The calculator opens on made-up counts of 50 trees in each of two woods, chosen so the arithmetic is easy to follow. The mixed wood has 10 birch, 15 oak, 12 ash, 8 rowan and 5 holly.
N = 10 + 15 + 12 + 8 + 5 = 50Σ(n/N)² = 558 ÷ 2,500 = 0.22321 − Σ(n/N)² = 1 − 0.2232 = 0.7768-
Σn(n − 1) = 10 × 9 + 15 × 14 + 12 × 11 + 8 × 7 + 5 × 4 = 90 + 210 + 132 + 56 + 20 = 508 N(N − 1) = 50 × 49 = 2,450D = 508 ÷ 2,450 = 0.20731 − D = 0.7927, and1/D = 2,450 ÷ 508 = 4.823
The birch wood holds the same five species, but 40 of its 50 trees are birch and the other
species have 4, 3, 2 and 1, so 1 − Σ(n/N)² = 1 − 1,630 ÷ 2,500 = 0.348. Its
Σn(n − 1) = 1,560 + 12 + 6 + 2 + 0 = 1,580, so
D = 1,580 ÷ 2,450 = 0.6449, 1 − D = 0.3551 and 1/D = 1.551.
Species richness and sample size cannot tell the two woods apart, yet the mixed wood’s index of
diversity is more than twice the birch wood’s by either form. Four trees in five being birch is
what pulls the second wood down: a pair picked there is usually two birches.
D, 1 − D or 1/D: which one your course uses
The letters are not used consistently, so check the formula rather than the name. The AP Biology sheet and OCR’s A Level
Biology A specification both square each species’ share of the total, and OCR names the result
D = 1 − Σ(n/N)², so its D is high for a diverse habitat. AQA’s index of diversity,
d = N(N − 1) ÷ Σn(n − 1), is the reciprocal 1/D, which is 4.823 for the mixed wood.
Chen, Wang and
Shen (2023) call the squared form the maximum likelihood estimator of the index from a sample
and the n(n − 1) form its unbiased estimator.
The two are tied exactly by 1 − D = (1 − Σ(n/N)²) × N ÷ (N − 1). For the mixed
wood the squared form gives 0.7768, and 0.7768 × 50 ÷ 49 = 0.7927. The gap is about
2 percent at 50 individuals and shrinks as samples grow, but when two habitats were sampled to
very different sizes the forms can rank them differently, and the calculator says so when that
happens.
Shannon’s index and evenness
Shannon’s index, H′ = −Σ p ln p with p = n ÷ N, comes from Claude
Shannon’s 1948 measure of information and is the other diversity index in wide use. It is 0
for a single species and reaches ln S when all S species are equally common, so dividing
by that ceiling gives Pielou’s evenness, J′ = H′ ÷ ln S, which runs from 0 to 1.
For the mixed wood H′ = 1.549 and J′ = 1.549 ÷ ln 5 = 0.962, close to
perfectly even, while the birch wood gives H′ = 0.756 and J′ = 0.470.
The two indices weight species differently. Simpson’s is dominated by the commonest species, while Shannon’s gives rare ones more weight, so a habitat with several rare extras can lead on H′ while another, more even among its common species, leads on 1 − Σ(n/N)². They agree about the two woods, and when they disagree the calculator says so. H′ also depends on the logarithm: it uses ln unless you switch to base 2, which gives H′ in bits, or base 10. Evenness comes out the same in any base.
What this calculator leaves out
- Sampling effort. Every index here depends on how hard you looked, because a bigger sample turns up more rare species. Compare habitats sampled the same way, with the same number of quadrats, traps or minutes of searching.
- A significance test. An index has no p-value of its own; Hutcheson’s t-test (1970) is a common way to compare two Shannon indices. To ask whether two habitats hold their species in different proportions, enter the same counts in the chi-square calculator as a species-by-habitat contingency table. The two woods give χ² = 36.04 on 4 degrees of freedom, with p below 0.001, if each tree is treated as an independent observation.
- Population size. The indices describe a sample, not how many individuals live in the habitat. To estimate a population of animals from a sample, use the mark-recapture calculator.
- Which species they are. Two habitats with no species in common can score the same, and a rare or protected species counts for no more than a common one.
- Diversity within a species. Genetic diversity is measured from allele and genotype frequencies, as in the Hardy-Weinberg calculator, not from counts of species.
- Percentage cover. n(n − 1) needs whole individuals. For cover or biomass, enter the values as whole numbers and read only 1 − Σ(n/N)² and H′, which depend on nothing but each species’ share.
- Change over time. An index is a snapshot. How two populations rise and fall together is the subject of the predator-prey simulator.
Common mistakes
- Reading a high D as high diversity. As Simpson’s index, D is the chance of a same-species pair, so the birch wood’s 0.6449 means less diversity than the mixed wood’s 0.2073.
- Mixing up the two Ds. OCR’s D is 1 − Σ(n/N)², a diversity, while Simpson’s D is the other way up. A D of 0.2 describes a diverse habitat in Simpson’s form and a habitat dominated by one species in OCR’s.
- Using n² where the formula says n(n − 1). For the mixed wood Σn² is 558 and Σn(n − 1) is 508, so the two cannot be swapped.
- Stopping a step early. 1 − Σ(n/N)², D, 1 − D and 1/D are four different numbers. Give the one the question asks for, and say which it is.
- Counting species alone. Richness misses evenness: both woods above have five species, and their indices differ by more than a factor of two.
- Comparing unequal samples. Fifty individuals from one site and 500 from another do not make a fair comparison, because the larger sample is likely to find more of the rare species.
Worked examples
Each one runs through the calculator above, so the arithmetic here is the arithmetic it does.
What is Simpson’s diversity for 25 mayflies, 15 caddisflies, 8 water boatmen and 2 leeches?
- S = 4 species
- N = 25 + 15 + 8 + 2 = 50
- Σn² = 25^2 + 15^2 + 8^2 + 2^2 = 625 + 225 + 64 + 4 = 918
- Σ(n/N)² = 918 / 50^2 = 0.3672
- 1 − Σ(n/N)² = 1 − 0.3672 = 0.6328
- 1/Σ(n/N)² = 50^2 / 918 = 2.7233
- Σn(n − 1) = 25 × 24 + 15 × 14 + 8 × 7 + 2 × 1 = 600 + 210 + 56 + 2 = 868
- N(N − 1) = 50 × 49 = 2450
- D = 868 / 2450 = 0.35429
- 1 − D = 1 − 0.35429 = 0.64571
- 1/D = 2450 / 868 = 2.8226
- H′ = −(0.5 × ln(0.5) + 0.3 × ln(0.3) + 0.16 × ln(0.16) + 0.04 × ln(0.04)) = 1.1297
- J′ = 1.1297 / ln(4) = 0.81493
0.6328 by the AP Biology equation sheet’s 1 − Σ(n/N)². The unbiased n(n − 1) form, further down the working, gives 0.6457 for the same net. Use the form on your own formula sheet and say which one you used.
What does a low Simpson’s diversity index mean for a pine plantation?
- S = 3 species
- N = 46 + 3 + 1 = 50
- Σn² = 46^2 + 3^2 + 1^2 = 2116 + 9 + 1 = 2126
- Σ(n/N)² = 2126 / 50^2 = 0.8504
- 1 − Σ(n/N)² = 1 − 0.8504 = 0.1496
- 1/Σ(n/N)² = 50^2 / 2126 = 1.1759
- Σn(n − 1) = 46 × 45 + 3 × 2 + 1 × 0 = 2070 + 6 + 0 = 2076
- N(N − 1) = 50 × 49 = 2450
- D = 2076 / 2450 = 0.84735
- 1 − D = 1 − 0.84735 = 0.15265
- 1/D = 2450 / 2076 = 1.1802
- H′ = −(0.92 × ln(0.92) + 0.06 × ln(0.06) + 0.02 × ln(0.02)) = 0.32376
- J′ = 0.32376 / ln(3) = 0.2947
0.15 is the chance that two trees picked at random, with replacement, are different species, so about 85 times in 100 you pick a matching pair, nearly all of them two pines. The single red maple’s share is 0.02, so it adds only 0.0004 to Σ(n/N)².
What is the Simpson’s diversity index of 470 birds of 6 species counted in a city park?
- S = 6 species
- N = 220 + 140 + 60 + 35 + 12 + 3 = 470
- Σn² = 220^2 + 140^2 + 60^2 + 35^2 + 12^2 + 3^2 = 48,400 + 19,600 + 3600 + 1225 + 144 + 9 = 72,978
- Σ(n/N)² = 72,978 / 470^2 = 0.33037
- 1 − Σ(n/N)² = 1 − 0.33037 = 0.66963
- 1/Σ(n/N)² = 470^2 / 72,978 = 3.0269
- Σn(n − 1) = 220 × 219 + 140 × 139 + 60 × 59 + 35 × 34 + 12 × 11 + 3 × 2 = 48,180 + 19,460 + 3540 + 1190 + 132 + 6 = 72,508
- N(N − 1) = 470 × 469 = 220,430
- D = 72,508 / 220,430 = 0.32894
- 1 − D = 1 − 0.32894 = 0.67106
- 1/D = 220,430 / 72,508 = 3.0401
- H′ = −(0.4681 × ln(0.4681) + 0.2979 × ln(0.2979) + 0.1277 × ln(0.1277) + 0.07447 × ln(0.07447) + 0.02553 × ln(0.02553) + 0.006383 × ln(0.006383)) = 1.2982
- J′ = 1.2982 / ln(6) = 0.72453
0.6696. Starlings’ 220² = 48,400 is 66 percent of the 72,978 in Σn², and starlings with sparrows make 93 percent: the two commonest birds set the index. The 3 blue jays add 9 to the sum, which is why a rare species counts for little in Simpson’s index.
Common questions
How do you calculate Simpson’s diversity index?
Count the individuals of each species, n, and of all species together, N. The AP Biology equation sheet gives Diversity Index = 1 − Σ(n/N)²: divide each species’ count by N, square it, add the squares and take the total from 1. For five species of 10, 15, 12, 8 and 5 individuals, the shares are 0.2, 0.3, 0.24, 0.16 and 0.1, so Σ(n/N)² = 558 ÷ 2,500 = 0.2232 and the index is 0.7768. The unbiased form for a sample uses n(n − 1) instead: Σn(n − 1) = 508 and N(N − 1) = 50 × 49 = 2,450, so D = 0.2073 and 1 − D = 0.7927.
What is the difference between D, 1 − D and 1/D?
They are three scales for one measurement. D is the chance that two individuals picked at random belong to the same species, so it falls as diversity rises. 1 − D is the chance that they belong to different species, and the reciprocal 1/D is 1 for a single species and rises with diversity. AQA’s index of diversity, d = N(N − 1) ÷ Σn(n − 1), is the same number as 1/D. Say which one you are quoting: a D of 0.8 means low diversity, while a 1 − D of 0.8 means high.
Why do some courses use 1 − Σ(n/N)² for Simpson’s index?
The AP Biology equation sheet prints it as the Diversity Index, and OCR’s A Level Biology A specification writes Simpson’s Index of Diversity as D = 1 − Σ(n/N)², so OCR’s D is high for a diverse habitat. It is the chance that two individuals picked with replacement belong to different species, and it needs only each species’ share of the total. Picking without replacement gives 1 − Σn(n − 1) ÷ N(N − 1), which Chen, Wang and Shen (2023) call the unbiased estimator. The squared form is never the higher of the two, because 1 − D = (1 − Σ(n/N)²) × N ÷ (N − 1): for 50 trees split 10, 15, 12, 8 and 5 among five species, the two give 0.7768 and 0.7927.
What is a high Simpson’s index of diversity?
1 − Σ(n/N)² runs from 0, when every individual belongs to one species, towards 1, but never past 1 − 1/N, which it reaches when every individual is a different species. The unbiased form, 1 − D, goes up to 1, which it reaches only when no two individuals share a species. Values near 1 need many species in similar numbers. There is no fixed threshold for high, so compare habitats sampled the same way: 50 trees split 10, 15, 12, 8 and 5 among five species give 0.78 by 1 − Σ(n/N)² and 0.79 by 1 − D, and the same five species split 40, 4, 3, 2 and 1 give 0.35 and 0.36.
How is the Shannon diversity index different from Simpson’s?
Shannon’s index, H′ = −Σ p ln p with p = n ÷ N, gives rare species more weight, while Simpson’s is dominated by the commonest. H′ is not capped at 1: it is 0 for a single species and ln S when all S species are equally common, so Pielou’s evenness, J′ = H′ ÷ ln S, puts it on a scale from 0 to 1. Fifty trees split 10, 15, 12, 8 and 5 among five species give H′ = 1.549 and J′ = 0.962. The two indices usually rank habitats the same way, but not always.
Can Simpson’s index be used with percentage cover?
Only in its Σ(n/N)² form. n(n − 1) counts pairs of whole individuals, so it means nothing for cover, but 1 − Σ(n/N)² and Shannon’s H′ depend only on each species’ share of the total, which cover provides. For three plants with 50, 30 and 20 percent cover, the shares are 0.5, 0.3 and 0.2, so 1 − Σ(n/N)² = 1 − (0.25 + 0.09 + 0.04) = 0.62.