Biology · Ecology

Shannon Index (Biodiversity)

The Shannon index (Shannon-Wiener index) measures the diversity of a community. It accounts for both species richness and the evenness with which individuals are distributed among the species.

AdvancedExam-relevant

Free · no credit card · in your study plan in 2 minutes

Formula

LaTeX: H' = -\sum_{i=1}^{S} p_i \cdot \ln(p_i)
H' and pᵢ are dimensionless; pᵢ = nᵢ/N is a proportion (0…1)

Variables & units – Shannon Index (Biodiversity)

SymbolMeaningUnit
H'Shannon diversity index (diversity of the community)– (dimensionless)
pᵢrelative frequency of species i, that is nᵢ/N– (0…1)
nᵢnumber of individuals of species icount
Ntotal number of all individualscount
Snumber of species (species richness)count

Derivation & background – Shannon Index (Biodiversity)

Claude Shannon developed the measure in 1948 in information theory; ecology adopted it as a diversity measure. Usually the natural logarithm ln is used (unit "nats"), more rarely log₂ or log₁₀. H' is zero for a single species and becomes maximal (Hmax = ln S) when all species are equally frequent. From H' and Hmax you compute the evenness E = H'/ln S as a measure of even distribution (0…1).

Exam blueprint

Validity range

Applies to diversity comparisons of communities whose species and individual counts are fully recorded or representatively sampled.

Derivation steps

Each species contributes its information content −ln(pᵢ), weighted by its frequency pᵢ; the sum measures the uncertainty about which species a random individual belongs to.

  1. 1Compute the relative frequencies pᵢ = nᵢ/N of each species.
  2. 2Sum pᵢ·ln(pᵢ) over all species and reverse the sign.

Rearrangements

Maximum diversity

Reached when all S species are equally frequent.

Evenness

Lies between 0 and 1; 1 means perfect even distribution.

Task variant

Three species with 10, 6, 4 individuals (N = 20). Compute H' and the evenness.

p = 0.5; 0.3; 0.2. H' = −(0.5·ln0.5 + 0.3·ln0.3 + 0.2·ln0.2) = −(−0.347 − 0.361 − 0.322) = 1.030. Hmax = ln3 = 1.099, so E = 1.030/1.099 = 0.94.

Four species with 25 individuals each (N = 100). What is H'?

All p = 0.25. H' = −4·(0.25·ln0.25) = −(ln0.25) = ln4 = 1.386 = Hmax, i.e. maximum diversity with evenness 1.

Common mistakes

Using absolute counts instead of proportions pᵢ.

The relative frequencies pᵢ = nᵢ/N enter the formula, not the raw numbers.

Forgetting the minus sign.

Since ln(pᵢ) is negative for pᵢ < 1, the leading minus makes H' positive.

Comparing H' values with different logarithms.

Only values with the same base (usually ln) are comparable.

Interpreting H' alone as evenness.

H' also depends on the number of species; the evenness E = H'/ln S separates both.

Exam context

  • Typical in ecology: comparing the species diversity of two sites and interpreting the evenness.

These mistakes cost points in real exams. The set drills them until they stick.

Formula cluster

Biodiversity measures

Connects species richness, probability and information theory.

Worked example

Community with 3 species, individuals 10, 6, 4 → N = 20, so p = 0.5; 0.3; 0.2. H' = −(0.5·ln0.5 + 0.3·ln0.3 + 0.2·ln0.2) = −(0.5·(−0.693) + 0.3·(−1.204) + 0.2·(−1.609)) = −(−0.347 − 0.361 − 0.322) = 1.030. The maximum would be Hmax = ln3 = 1.099, so the evenness is E = 1.030/1.099 = 0.94.

Applications

Ecology (comparing species diversity of habitats), environmental monitoring, evaluating restoration and disturbances, water quality

Quanta exam set

Curated exam set for "Shannon Index (Biodiversity)":

Question (front)

Which formula describes Shannon Index (Biodiversity)?

Answer in your set

Question (front)

How do you rearrange H' = −Σ pᵢ·ln(pᵢ) for Maximum diversity?

Answer in your set

Question (front)

Which common mistake happens with Shannon Index (Biodiversity)?

Answer in your set

+ 8 more cards: units, variables, derivation, example, exam task

These 11 cards are ready. One click and they sit in your deck, FSRS schedules the reviews until exam day.

Scientific sources

Common notations & search queries

H' = -sum p_i ln(p_i)H=-Σpi·ln(pi)Shannon-IndexShannon-Wiener-IndexBiodiversität FormelDiversitätsindexshannon diversity indexEvenness berechnenArtenvielfalt Index

Related formulas

More Biology formulas

Frequently asked questions about Shannon Index (Biodiversity)

How do you calculate the Shannon index?+

First you determine the relative frequency pᵢ of each species, that is the number of individuals of the species divided by the total number of all individuals. Then you compute the product pᵢ·ln(pᵢ) for each species, sum these values over all species and finally reverse the sign. The leading minus is needed because the logarithm of numbers below 1 is negative. Example: three species with 10, 6 and 4 individuals give the proportions 0.5, 0.3 and 0.2 at N = 20. Then H' = −(0.5·ln0.5 + 0.3·ln0.3 + 0.2·ln0.2) = −(−0.347 − 0.361 − 0.322) = 1.03. The larger H', the more diverse the community. It is important to always use the same logarithm, usually the natural ln.

What does a high Shannon index mean?+

A high Shannon index indicates great diversity. It is driven by two factors: species richness, that is how many species occur, and evenness, that is how uniformly the individuals are distributed among the species. The index is maximal exactly when many species occur and all are roughly equally frequent. If, by contrast, a single species dominates strongly, the index stays low even when many species are present. A low value therefore points to a species-poor community or one dominated by few species. In practice you compare the index between sites or over time to detect changes in species diversity, for example after a disturbance or restoration. Absolute values are only meaningfully comparable with the same logarithm base and similar sampling.

What is evenness and how does it relate to the Shannon index?+

Evenness measures how uniformly the individuals are distributed among the species, independent of how many species there are. It follows from the Shannon index divided by its maximum: E = H'/ln S, where S is the number of species. The maximum Hmax = ln S is reached when all species are equally frequent. Evenness lies between 0 and 1: a value near 1 means all species occur similarly often, a value near 0 that one species strongly dominates. Example: three species with proportions 0.5, 0.3 and 0.2 have H' = 1.03 and Hmax = ln3 = 1.099, so E = 0.94, a fairly even distribution. Evenness thus separates the even-distribution aspect from pure species richness, which H' alone mixes together.

Which logarithm do you use for the Shannon index?+

In ecology the natural logarithm ln is most common; the unit is then called "nats". Some sources use the base-2 logarithm log₂, giving units in "bits", or the base-10 logarithm log₁₀. The choice only changes the numerical value, not the statement: a conversion factor transforms the values into each other, since log₂(x) = ln(x)/ln2. What matters is that you always use the same base within a comparison, otherwise the values are not comparable. The maximum also depends on the base: with ln, Hmax = ln S, with log₂ it would be log₂ S. For evenness the base cancels, because you divide H' by Hmax with the same base, so evenness always gives the same value between 0 and 1. Therefore check before every comparison which base was used.

What is the difference between the Shannon index and the Simpson index?+

Both measure diversity but weight differently. The Shannon index H' = −Σ pᵢ·ln(pᵢ) comes from information theory and reacts comparatively sensitively to rare species, because their information content −ln(pᵢ) is large. The Simpson index D = Σ pᵢ² is the probability of drawing the same species twice and emphasises common, dominant species more strongly; rare species barely influence it. As a diversity measure one usually uses 1 − D or the reciprocal 1/D with the Simpson index, which increase with diversity, while D itself measures dominance. In practice both complement each other: the Shannon index suits cases where rare species matter, the Simpson index where the dominance structure is decisive. Often one computes both to get a complete picture of the diversity.

Retain Shannon Index (Biodiversity) for exams

Create a curated FSRS exam set for H' = −Σ pᵢ·ln(pᵢ): formula recall, variables, derivation, rearrangement, worked example, common mistakes and exam context.

Free · curated formula set · LaTeX · FSRS spaced repetition

How do you calculate with Shannon Index (Biodiversity)?

Here is how to work through a typical Shannon Index (Biodiversity) (H' = −Σ pᵢ·ln(pᵢ)) task step by step:

  1. 1

    Task

    Three species with 10, 6, 4 individuals (N = 20). Compute H' and the evenness.

    Solution path

    p = 0.5; 0.3; 0.2. H' = −(0.5·ln0.5 + 0.3·ln0.3 + 0.2·ln0.2) = −(−0.347 − 0.361 − 0.322) = 1.030. Hmax = ln3 = 1.099, so E = 1.030/1.099 = 0.94.

  2. 2

    Task

    Four species with 25 individuals each (N = 100). What is H'?

    Solution path

    All p = 0.25. H' = −4·(0.25·ln0.25) = −(ln0.25) = ln4 = 1.386 = Hmax, i.e. maximum diversity with evenness 1.