Biology & Life Sciences
Advanced

Shannon Diversity Index

Measures species diversity in a community.

Formula

H=−∑piln⁡piH = -\sum p_i \ln p_i

Variables

p_iProportion of species i

How it works

The Shannon Diversity Index combines two ideas: how many species are present and how evenly individuals are distributed among them. Each species contributes piln⁡pip_i \ln p_i, so very common species and very rare species affect the total differently; the minus sign makes the final value positive. It is rooted in information theory, where the index measures the uncertainty in predicting the species identity of a randomly chosen individual: the less predictable the community, the higher the diversity.

When to use it

Use this when you want a single number to compare biodiversity across sites, habitats, treatments, or time points, especially in ecology, microbiology, and conservation biology. It is most useful when species abundance data are available, not just a presence/absence list.

Worked example, step by step

Suppose a sample contains 3 species with counts 40, 35, and 25.

Step 1: Find the total number of individuals: 40 + 35 + 25 = 100.

Step 2: Convert counts to proportions:

p1=40/100=0.40p_1 = 40/100 = 0.40

p2=35/100=0.35p_2 = 35/100 = 0.35

p3=25/100=0.25p_3 = 25/100 = 0.25

Step 3: Compute each term using natural logs:

0.40ln⁡(0.40)=0.40(−0.9163)=−0.36650.40\ln(0.40) = 0.40(-0.9163) = -0.3665

0.35ln⁡(0.35)=0.35(−1.0498)=−0.36740.35\ln(0.35) = 0.35(-1.0498) = -0.3674

0.25ln⁡(0.25)=0.25(−1.3863)=−0.34660.25\ln(0.25) = 0.25(-1.3863) = -0.3466

Step 4: Sum the terms:

∑piln⁡pi=−0.3665−0.3674−0.3466=−1.0805\sum p_i\ln p_i = -0.3665 - 0.3674 - 0.3466 = -1.0805

Step 5: Apply the minus sign:

H=−(−1.0805)=1.0805H = -(-1.0805) = 1.0805

Final answer: H≈1.08H \approx 1.08.

Common mistakes to avoid

  • Using raw species counts instead of proportions that sum to 1
  • Forgetting the negative sign, which makes the index appear negative
  • Mixing logarithm bases without noting that the numeric value changes

Did You Know?

Low genetic diversity endangers species like cheetahs, leaving them dangerously vulnerable to disease.

Share this formula

Educational examples use simplified assumptions. Check units and applicability before using a result; health, financial and safety decisions need appropriate professional guidance. About FormulaWon · Report a correction