The Shannon diversity index calculator is a tool which helps you to estimate the diversity of species within a community. Knowing what the Shannon diversity index is can provide ecologists with useful information about a given habitat.

Read on to learn what the Shannon–Wiener diversity index is, what it can tell you, and how to use the Shannon diversity index formula.

What is the Shannon diversity index?

The Shannon diversity index (a.k.a. the Shannon–Wiener diversity index) is a popular metric used in ecology. It's based on Claude Shannon's formula for entropy and estimates species diversity. The index takes into account the number of species living in a habitat (richness) and their relative abundance (evenness).

How to use the Shannon diversity index calculator?

To get the Shannon-Wiener diversity index for your data set, input the number of individuals in each species into the calculator. You can enter up to 40 samples.

At the bottom, you'll see the results - Shannon diversity index, evenness, richness, the total number of individuals, and average population size. The default results are rounded to three significant figures. You can change the rounding in the advanced mode of the Shannon diversity index calculator.

Another thing you can set up in the advanced mode is the base of the logarithm used in a formula for the Shannon index. By default, the calculator uses the natural logarithm.

Shannon diversity index formula

What is the Shannon diversity index mathematically? Have a look at the equation:

H=[(pi)×log(pi)]H = -\sum[(p_\mathrm{i})×\mathrm{log}(p_\mathrm{i})]


  • HH - Shannon diversity index;
  • pip_\mathrm{i} - proportion of individuals of i-th species in a whole community;
  • - sum symbol; and
  • log\mathrm{log} - usually the natural logarithm, but the base of the logarithm is arbitrary (10 and 2 based logarithms are also used).
  • nn - individuals of a given type/species; and
  • NN - total number of individuals in a community,

How to calculate the Shannon diversity index?

Use the Shannon diversity index formula:

H=[(pi)×ln(pi)]H = -\sum[(p_\mathrm{i})×\mathrm{ln}(p_\mathrm{i})]
  1. Calculate the proportion (pi) of each species - divide the number of individuals in a species by the total number of individuals in the community.

  2. For each species, multiply the proportion by the logarithm of the proportion.

  3. Sum all the numbers from step 2.

  4. Multiply the sum by -1.

Example of how to calculate Shannon diversity index

Imagine we need to assess the species diversity in a part of a rain forest. We know that 5 scarlet macaws, 13 blue morpho butterflies, 2 capybaras, 5 three-toed sloths, and 1 jaguar live in the region we are interested in.


Number of individuals (n)

Proportion pi=n/N



Scarlet Macaw





Blue Morpho Butterfly










Three-Toed Sloth










To calculate diversity, we will use the Shannon diversity index formula:

H=[(pi)×ln(pi)]H = -\sum[(p_\mathrm{i})×\mathrm{ln}(p_\mathrm{i})]
  1. First of all, we need the total number of individuals:

    N = 5 + 12 + 2 + 5 + 1 = 25.

  2. For each species, calculate its proportion in the whole community (third column of the table).

  3. Multiply ln(pi) by pi and round the answer to three decimal places (fourth column).

  4. Sum all the results from the final column according to the Shannon-Wiener diversity index equation. Since we were going to multiply them by -1, we can do it straight away and ignore the minus signs:

    H = 0.322 + 0.352 + 0.202 + 0.322 + 0.129 = 1.327

  5. Here's our rounded Shannon-Wiener diversity index: H ≈ 1.3.

If you want to know more about ecology & statistics, take a look at our tools:

Shannon diversity index's range of values

The minimum value the Shannon diversity index can take is 0. Such a number would tell us that there's no diversity - only one species is found in that habitat.

There's no upper limit to the index. The maximum value occurs when all species have the same number of individuals. It equals log(k), where k is the number of species.

To give you some perspective on the Shannon diversity index's range of values (using the natural logarithm as the base): for 100 species, the maximum possible value would be 4.605, for 1,000 species: 6.908, for 10,000 species: 9.21, for 1,000,000 species: 13.816. For all eukaryotic species discovered on Earth, the maximum possible would equal log(8,700,000) = 15.98.

In real-world ecological data, the Shannon diversity index's range of values is usually 1.5 - 3.5.


What does the Shannon diversity index tell you?

The Shannon diversity index tells you how diverse the species in a given community are. It rises with the number of species and the evenness of their abundance.

How to interpret the Shannon diversity index?

The higher the index, the more diverse the species are in the habitat. If the index equals 0, only one species is present in the community.

It may be easier to interpret the result if you calculate the evenness: E = H / ln(k), where k is the number of species. Evenness gives you a value between 0 and 1 (so you can think of it as a percentage). Remember: a habitat's diversity increases when its evenness becomes closer to 1.

Can Shannon diversity index be over 1?

Yes, Shannon diversity index can go over 1. For example, the index for a community of 6 species with 100 individuals each equals around 1.79. The Shannon index shouldn't be confused with evenness, another commonly used metric in ecology, which takes values between 0 and 1.

Rita Rain
Enter up to 40 numbers (new rows will appear):
Population 1
Population 2
Population 3
Check out 23 similar ecology calculators
Bag footprintBooks vs e-BooksCar vs. Bike… 20 more
People also viewed…

Bag footprint

Our bag footprint calculator helps you determine how often you need to reuse alternatives to plastic bags to overcome their negative environmental impact.

Free fall

Our free fall calculator can find the velocity of a falling object and the height it drops from.

Hand drying footprint

If what to choose in a public restroom is your everyday dilemma - don't wait any longer. Check out this great hand-drying footprint calculator and change your habits!

Significant figures

The significant figures calculator performs operations on sig figs and shows you a step-by-step solution!
Copyright by Omni Calculator sp. z o.o.
Privacy policy & cookies
main background