# How to Calculate Shannon Wiener Diversity Index - Formula, Example

## How to Calculate Shannon Wiener Diversity Index - Definition

This tutorial explains how to calculate the Shannon Wiener diversity index and Evenness.

#### Formula:

H = -SUM[(pi) * ln(pi)] E=H/Hmax Where, SUM = Summation pi= Numbe of individuals of species i/total number of samples S = Number of species or species richness Hmax = Maximum diversity possible E= Eveness=H/Hmax
##### Example :

The samples of 5 species are 60,10,25,1,4. Calculate the Shannon diversity index and Evenness for these sample values.

##### Given :

Sample Values (S) = 60,10,25,1,4 number of species (N) = 5

##### To Find :

shannon diversity index and Evenness

##### Solution :
###### Step 1:

First, let us calculate the sum of the given values.

 sum = (60+10+25+1+4) = 100
###### Step 2:
No of samplepi=sample/sumln(pi)pi*ln(pi)
600.60-0.51-0.31
100.10-2.30-0.23
250.25-1.39-0.35
10.01-4.61-0.05
40.04-3.22-0.13
sum=100SUM = -1.07

H=1.07

###### Step 3:

Hmax=ln(N)=ln(5)=1.61 Evenness=H/Hmax=1.07/1.61=0.66

##### Result :

Shannon diversity index(H)=1.07 Evenness =0.66