Shannon Diversity Index (H′)

Enter the number of individuals for each species (up to 40). Auto-updates as you type.

Controls

Species counts

Rows: 0/40

Actions

Results (auto-updating)

Log base: ln
Shannon index (H′)
Evenness (E)
Richness (k, species with n>0)
Total individuals (N)
Average per species (N/k)
Classification

Quick summary will appear here after you enter counts.

Step-by-step derivation

Provide at least one non-zero count to see the algebraic steps.

References

  1. Formula: H′ = −Σ (pᵢ · log_b(pᵢ)), where pᵢ = nᵢ / N, N = Σ nᵢ, b ∈ {e,10,2}.
  2. Evenness: E = H′ / log_b(k) for k ≥ 2; else E = 0.
  3. Shannon (1948) “A Mathematical Theory of Communication”.
  4. Ecology practice commonly uses ln, log₁₀, or log₂; base only rescales H′.

Use this Shannon Diversity Index Calculator to measure diversity from species abundance counts. Enter the number of individuals for each species to calculate the Shannon index (H′), evenness, richness, and total sample size.

Shannon Diversity Index Formula

First calculate the proportion of each species:

pi = ni ÷ N

Then calculate the Shannon index:

H′ = −Σ[pi × log(pi)]

Where:

  • ni = number of individuals of species i
  • N = total number of individuals
  • pi = proportion represented by species i

The calculator supports natural log (ln), base 10, and base 2. Use the same log base when comparing different samples.

Evenness

E = H′ ÷ log(k)

Where k is the number of species with non-zero counts. Evenness approaches 1 when individuals are distributed more evenly among the species.

Example

Suppose four species have counts of 10, 20, 30, and 40.

Total individuals = 100

The species proportions are:

0.10, 0.20, 0.30, and 0.40

Using natural logarithms:

H′ = −[(0.10 × ln 0.10) + (0.20 × ln 0.20) + (0.30 × ln 0.30) + (0.40 × ln 0.40)]

H′ ≈ 1.280

With four species:

E = 1.280 ÷ ln(4) ≈ 0.923

The sample therefore has a Shannon index of approximately 1.280 and relatively high evenness.

Important Notes

  • Higher H′ generally indicates greater diversity when comparable samples are used.
  • There is no universal value that defines “low,” “medium,” or “high” Shannon diversity for every ecosystem.
  • Compare samples using the same log base, sampling method, area, timing, and similar sampling effort.
  • Small samples or missed rare species can affect richness and the calculated index.
  • Shannon diversity combines richness and relative abundance but does not by itself measure ecosystem health or conservation value.

Sources

View Sponsored Offers →

Related Tools

Plastic Footprint Calculator

Plastic Footprint Calculator to estimate your annual plastic use and waste so you can understand and reduce your environmental impact.