Margalef Richness Index Calculator
Written by Thierno Sadou Diallo, formula verified per our methodology • Last checked on 9/9/2026
The Margalef richness index is calculated with (S − 1) ÷ ln(N), where S is the number of species observed and N the total number of individuals counted in the sample.
Explanation
The Margalef index is a species richness measure that corrects a simple but important bias: the more individuals you sample, the more likely you are to observe new rare species, even without the community actually being richer. By dividing (S − 1) by the natural logarithm of N rather than by N itself, the Margalef index dampens this sampling-effort effect while remaining sensitive to the number of species observed: the "−1" in the numerator mechanically brings the index down to exactly 0 when only one species is present, regardless of how many individuals were counted, making it a natural benchmark for a community totally dominated by a single species. This index differs from the Shannon diversity index, which combines both richness (number of species) and evenness (how abundances are distributed among those species) into a single value: two communities can have an identical Shannon index while their actual species richness differs markedly, if one has more species but very uneven abundances. By focusing solely on the ratio between the number of species and sampling effort, the Margalef index directly complements the species-area relationship, which also predicts the expected number of species, but as a function of the studied area rather than the number of individuals counted.
Example: 10 species observed among 200 individuals counted
Inputs
Number of species: 10. Total number of individuals: 200.
Calculation
Margalef index = (10 − 1) ÷ ln(200) = 9 ÷ 5.2983 ≈ 1.6986.
Result
This sample gets a Margalef richness index of about 1.70.
Frequently asked questions
Why divide by the logarithm of the number of individuals rather than by that number itself?
Because the rate of discovering new species slows down as sampling grows (a species-accumulation curve progressively flattens), whereas a simple division by N would penalize large samples far too heavily. The logarithm corrects for this effect more realistically, in line with how the discovery of new species actually slows down in the field.
What is the reference value for calling a community "rich"?
There is no universal absolute threshold: the Margalef index is mainly used to compare several samples against each other (before/after a disturbance, or across several sites), not to label a single isolated value as "rich" or "poor" in absolute terms. Typical values vary enormously depending on the taxon studied and the ecosystem.
How does this index differ from the species-area relationship?
The Margalef index relates the number of species to sampling effort (the number of individuals counted), while the species-area relationship relates the number of species to the geographic area studied. Both measure a form of species richness, but along two different axes: one concerns sampling intensity, the other its spatial extent.