CalcDepo

Shannon Diversity Index Calculator

Compute the Shannon index and evenness of a community.

Inputs

Results

Shannon index H′1.279854
Maximum H′ (ln S)1.386294
Evenness0.9232197

Chart

Not what you need? Search by intent

Describe what you want to find — “species evenness” — and jump to the right calculator.

How to use the shannon diversity index calculator

Compute the Shannon index and evenness of a community. Enter counts per species in the field above; the shannon index h′, maximum h′ (ln s), evenness are computed instantly and plotted on the chart so you can see how the answer changes.

Formula

Shannon index H′ = -sum(n.map(function(v){return v / sum(n) × ln(v / sum(n))}))
Maximum H′ (ln S) = ln(len(n))
Evenness = [Shannon index H′] / [Maximum H′ (ln S)]

Variables

  • n — Counts per species

Worked example

With counts per species = 10,20,5,15, the calculator gives shannon index h′ ≈ 1.279854; maximum h′ (ln s) ≈ 1.386294; evenness ≈ 0.9232197.

Frequently asked questions

What is the formula for the shannon diversity index calculation?

Shannon index H′ = -sum(n.map(function(v){return v / sum(n) × ln(v / sum(n))})). Maximum H′ (ln S) = ln(len(n)). Evenness = [Shannon index H′] / [Maximum H′ (ln S)]. Here n is counts per species.

What inputs do I need for the shannon diversity index calculator?

You need counts per species. Each field is pre-filled with a typical example so you can see how the result responds as you edit the numbers.

How do I use this calculator?

Type values into the input fields. Results and the chart update instantly. Use Reset to restore the example values, Copy results to paste them elsewhere, or Share to copy a link that preserves your inputs.

Is the result exact?

Calculations use standard formulas and double-precision arithmetic, then display about seven significant figures. Real-world measurements carry uncertainty, so treat results as estimates unless your inputs are exact.

Related calculators

More in Ecology & Evolution: Exponential Population Growth · Logistic Population Growth · Population Density · Mark–Recapture Population · Population Change Rate · Simpson's Diversity Index · Species–Area Relationship · Carrying Capacity from Resources