Shannon diversity index

Shannon diversity index: use species counts, logarithm base. Review the formula, worked example and calculation steps.

Inputs

Use the units shown
RESULT
—

Enter your values and select Calculate.

Formula & explanation
H = −Σ pᵢ log_b(pᵢ)

Variables & units

Species counts
comma separated
Logarithm base
Select an option

Worked example

Use the example inputs to explore this model; the solution shows each supplied quantity.

Assumptions

Probabilities are estimated from counts; zero-count categories contribute zero.

Formula version 1.0.0. JavaScript floating-point arithmetic applies. Results display up to 6 decimal places; stored values retain available precision. Use the units shown.

Practice with an example

Use the default input values to find the answer. The reset icon restores those values.

Calculated on your device. Your latest 100 calculations stay in this browser.