Home · Everyday · Life, School & Work · Shannon Diversity Index Calculator

Shannon Diversity Index Calculator

The Shannon diversity index H′ of a community from species counts — richness and evenness in one number.

Your figures

Example result — edit the figures to make it yours

1.0297

Shannon diversity index H′

H′ = −Σ pᵢ ln pᵢ over species proportions — ecology's standard diversity measure, using the natural log. It grows with both the number of species and how evenly individuals are spread among them. The maximum for S species is ln S, reached when all are equally common.

Species present (richness)3
Total individuals100
Evenness H′ / ln(S)0.9372
Maximum possible (ln S)1.0986

What this calculator does

The Shannon diversity index H′ of a community from species counts — richness and evenness in one number. Where a measure is involved, US and metric units are both accepted — flip the unit toggle and the figures convert with the same definitions the formula uses. Every result on this page is computed from the formula stated below, with no hidden rounding steps.

The formula and method

H′ = −Σ pᵢ ln pᵢ over species proportions

The index is H′ = −Σ pᵢ ln pᵢ over species proportions pᵢ, using natural logarithms.

Higher H′ means more diversity: more species, or a more even spread.

Counts of zero contribute nothing and are ignored.

Worked example

With the example inputs this page opens with, the result is 1.0297 — shannon diversity index h′. H′ = −Σ pᵢ ln pᵢ over species proportions — ecology's standard diversity measure, using the natural log. It grows with both the number of species and how evenly individuals are spread among them. The maximum for S species is ln S, reached when all are equally common.

Quick reference

Quick reference — the worked example in full
FigureValue
Shannon diversity index H′1.0297
Species present (richness)3
Total individuals100
Evenness H′ / ln(S)0.9372
Maximum possible (ln S)1.0986

Computed with the same formulas as the calculator above — enter any values there for figures beyond this table.

Common questions

How does the Shannon Diversity Index Calculator work?

The Shannon diversity index H′ of a community from species counts — richness and evenness in one number. Species counts → H′. The result updates as you type, and the formula and method on this page state the exact definitions used, so you can reproduce the calculation by hand.

What inputs does the Shannon Diversity Index Calculator need?

Species counts → H′. Invalid entries — such as a zero denominator, an out-of-range value or a malformed list — produce a plain-language message instead of a misleading number.

Is the Shannon Diversity Index Calculator free to use?

Yes. It runs entirely in your browser with no sign-up, and the same calculator is available as an embeddable widget via the Embed button, so it can be placed on another site with its calculation intact.