Calculate common diversity and evenness indices from species abundance data
Enter your counts for each species (as comma-separated values).
Species Richness (S): The total number of species present.
Margalef's Richness (DMg): Adjusts species count for sample size.
Formula: DMg = (S−1)/ln(N), where S is species richness and N is the total number of individuals. Not defined for a single individual (N=1).
Shannon-Wiener Index (H'): Also known as the Shannon Diversity Index or simply the Shannon Index. Accounts for both abundance and evenness.
Higher values indicate greater diversity. Minimum value of 0 with no fixed upper limit, although real-world ecological data usually falls between 1.5-3.5.
Formula: H' = -Σ(pᵢ×ln(pᵢ)), where pᵢ is the proportion of individuals belonging to the i-th species.
The value reported is the standard (maximum-likelihood) estimator, matching common ecological software such as the vegan package in R. Shannon diversity is often converted to an effective number of species by taking its exponential, eᴴ' — the number of equally common species that would produce the same diversity value.
Brillouin Index (HB): An exact measure of the diversity of the collection in hand, making no assumptions about sampling.
No fixed upper limit, with higher values indicating greater diversity.
Formula: HB = (ln(N!)−Σln(nᵢ!))/N, where N is the total number of individuals and nᵢ is the number of individuals of the i-th species.
It is most appropriate when every individual has been counted (a complete census), since it describes the specific collection rather than estimating a wider population.
Simpson's Index (D): The probability that two randomly selected individuals belong to the same species. Accounts for both abundance and evenness.
Range: 0-1, where lower values indicate higher diversity.
Formula: D = Σ(pᵢ²), where pᵢ is the proportion of individuals belonging to the i-th species.
Because a higher value indicating lower diversity can seem counterintuitive, Simpson's Index is often re-expressed as 1−D (the Gini-Simpson Index) or 1/D (the Inverse Simpson Index). This calculator reports the plug-in form (Σpᵢ²); for sample data, some references instead use the unbiased estimator Σnᵢ(nᵢ−1)/[N(N−1)].
Pielou's Evenness (J'): Also known as Shannon's Evenness. Derived from H' — measures how close species abundances are to being equal.
Range: 0-1, where 1 = complete evenness.
Formula: J' = H'/ln(S), where H' is the Shannon Index and S is the species richness.
Not defined for a single species (S=1).
Simpson's Evenness (E1/D): Based on Simpson's Index — measures evenness independent of richness.
Range: 0-1, where 1 = all species are equally abundant. E1/D can also be represented simply as E.
Formula: E = (1/D)/S, where D is Simpson's Index and S is the species richness.
Berger-Parker Dominance (d): Simple measure of dominance, expressed as the proportional abundance of the most abundant species.
Range: 1/S to 1, where higher values indicate greater dominance.
Formula: d = n_max/N, where n_max is the number of individuals of the most abundant species and N is the total number of individuals.
Every index is shown for any dataset, but they suit different situations. Richness-based measures (S, Margalef) are sensitive to sampling effort, so compare them only across equivalent sampling. Shannon and Simpson are the most widely reported general-purpose diversity indices and are routinely used for sample data. Brillouin is best reserved for complete counts, where you have enumerated every individual. Dominance and evenness measures help interpret whether diversity is driven by richness or by how abundance is distributed among species.
How to cite this tool:
Carvello, S.F. (2025) Diversity Indices Calculator. Available at: https://ug.sebc.me/labs/diversity-indices.
I'm always interested to hear from researchers and educators putting these tools to good use, so please do feel free to drop me a line if you've found this calculator helpful or cited it — sf@carvello.org :)