CalcGallery

Shannon Diversity Index Calculator

Shannon H, evenness and effective species from counts.

Built by AbhiLast reviewed September 25, 2026

Your numbers

Row 1
Row 2
Row 3

One species per row: how many individuals, or another abundance such as percent cover. Zero rows are ignored.

Result

Shannon index, H: 1.029653

Describes this sample only. Rare species a sample missed are not in it, so a bigger sample usually finds a higher H.

Largest possible H for this many species
1.098612
Evenness, J
0.937231
Effective number of species
2.800094
Species present
3
Total individuals
100
Report a problem with this calculator
Your entries are kept on this device only.

Results follow the mathematical operation and values shown. Check that you selected the intended operation, convention and dataset type before relying on the result. Read the full disclaimer

How to use the Shannon Diversity Index Calculator

  1. Enter one row per species with the number of individuals counted, or another abundance such as percent cover.
  2. Choose the logarithm, natural log unless your course or paper uses base 2 or base 10.
  3. Read H, the evenness, the largest H possible with that many species, and the effective number of species.

The formulas

pᵢ = nᵢ ÷ N                        share of species iH  = −(p₁ log p₁ + p₂ log p₂ + … + p_S log p_S)H max = log S                      all species equally commonJ  = H ÷ ln S                      evenness (natural logs on both)effective number of species = e^H  (with H in natural logs)

S is the number of species with a count above zero and N the total count. A species with a count of zero contributes nothing to H and is not counted in S.

What the diagram shows

Each species’ share of the sample as a bar, from the most common to the least. The flatter the row of bars, the higher the evenness.

With your numbers

  1. H = −(0.5 ln 0.5 + 0.3 ln 0.3 + 0.2 ln 0.2) = 1.029653 in natural logs

Quick reference

Describes this sample only. Rare species a sample missed are not in it, so a bigger sample usually finds a higher H.

Common math examples, worked out with this calculator's starting values.
ExampleShannon index, H
50, 30 and 201.029653
Four species, 10 each1.386294
One species only0
Two equal species, in bits1
50, 30 and 20 in base 100.447173
Eight species, 35 down to 21.763607

Common questions about the Shannon Diversity Index Calculator

What does the Shannon index measure?
How hard it is to predict the species of the next individual you pick from the sample. It rises with the number of species and with how evenly the individuals are shared among them. A sample of 50, 30 and 20 individuals of three species has an H of about 1.03 in natural logs.
Which logarithm should I use?
Whichever the work you are comparing with uses; ecology most often uses the natural log. Changing the base only rescales H: the same sample is about 1.03 in natural logs, 1.49 in base 2 and 0.45 in base 10. Evenness and the effective number of species come out the same in every base, which makes them easier to compare.
What are evenness and the effective number of species?
Evenness, Pielou's J, is H divided by the largest H possible for that many species, ln S, so it runs from near 0 when one species dominates to 1 when all are equally common. The effective number of species, e to the power H, is how many equally common species would give the same H: about 2.8 for the 50, 30 and 20 sample.
Can I compare H between two samples?
With care. H depends on how hard you looked: a bigger sample tends to find rarer species and a higher H. Compare samples collected the same way and of similar size, and remember that the index describes the sample, not the whole habitat.

Report a problem with this calculator