Margalef Index Calculator
Ecology & diversity
- Inputs: 48 species recorded among 1,250 individuals; Margalef's index corrects the raw count for sampling effort on a log scale.
- Log scale: ln(1,250) = 7.1309, and the numerator is S - 1 = 47.
- Division: 47 / 7.1309 = 6.5910; the Menhinick alternative, S / sqrt(N), would give 1.3576 for the same sample.
- Margalef result: 6.5910; values above about 5 usually indicate a rich, well-sampled community.
Species richness is the simplest diversity measure and the most treacherous, because bigger samples always find more species. A net hauled twice as long catches rarities the first haul missed, so raw counts reward effort rather than richness. Margalef's index, proposed in 1958, was one of the first attempts to discount the count by the effort that produced it.
The discount is logarithmic: divide S - 1 by the natural logarithm of N, the total number of individuals. Doubling the sample then adds a constant to the denominator rather than doubling the score, which roughly matches how species actually accumulate. The result is a single number that can be compared, cautiously, across samples of different sizes.
Enter the species count and the number of individuals. Alongside the Margalef value the calculator prints ln N and the Menhinick index, the other classic effort correction, so you can see whether the two agree on your sample.
Worked examples
Margalef index of a reef sample
(48 · 1250)
| Margalef index | 6.5910 |
| Log of individuals ln N | 7.1309 |
| Menhinick index (comparison) | 1.3576 |
Margalef index of a meadow sample
(23 · 486)
| Margalef index | 3.5563 |
| Log of individuals ln N | 6.1862 |
| Menhinick index (comparison) | 1.0433 |
Margalef index of a trawl sample
(87 · 9320)
| Margalef index | 9.4093 |
| Log of individuals ln N | 9.1399 |
| Menhinick index (comparison) | 0.9012 |
Richness corrected for effort
The subtraction of 1 from S anchors the index at zero for a sample containing a single species, however many individuals it holds. The logarithm does the heavier work: in the worked examples, ln N runs from 6.1862 for 486 individuals to 9.1399 for 9,320, so a nineteen-fold increase in sampling only halves the denominator's growth relative to the species gain.
The first example pairs 48 species with 1,250 individuals for an index of 6.5911. The third sample is richer still — 87 species — and even after discounting 9,320 individuals it scores 9.4091, a genuinely richer community rather than merely a bigger net. The smallest sample, 23 species among 486 individuals, scores 3.5563.
| Margalef value | Usual reading | Context |
|---|---|---|
| Under 2 | Poor richness | Stressed or very young communities |
| 2 - 5 | Moderate richness | Many temperate field samples |
| 5 - 8 | Rich | Well-sampled diverse habitats |
| Above 8 | Very rich | Tropical or exceptional samples |
Margalef vs Menhinick
Menhinick's correction divides S by the square root of N instead of a logarithm. The two indices embed different beliefs about how species accumulate: the square root assumes faster accumulation than the log at large N, so Menhinick punishes big samples harder. On the first example Menhinick gives 1.3576 against Margalef's 6.5911 — different scales entirely, so only rankings within one index are meaningful.
Rankings themselves can flip between the indices when samples differ greatly in size, which is why reporting both, as this page does, is honest practice. When they disagree, the modern answer is rarefaction — comparing richness at a standardised number of individuals — rather than arguing over which correction is canonical.
- Both indices still grow with sampling effort; they soften the bias, they do not remove it.
- Never compare a Margalef value with a Menhinick value; the scales are unrelated.
- A single-species sample scores exactly 0 however large N becomes.
- Report S and N alongside the index so readers can recompute or rarefy.
- Values above about 5 usually indicate rich communities, but habitat context rules.
Worked examples
Example 1: Species count S 48; Total individuals N 1250. Margalef index = 6.5910. Supporting values: Log of individuals ln N 7.1309; Menhinick index (comparison) 1.3576. Inputs: 48 species recorded among 1,250 individuals; Margalef's index corrects the raw count for sampling effort on a log scale. Log scale: ln(1,250) = 7.1309, and the numerator is S - 1 = 47. Division: 47 / 7.1309 = 6.5910; the Menhinick alternative, S / sqrt(N), would give 1.3576 for the same sample. Margalef result: 6.5910; values above about 5 usually indicate a rich, well-sampled community.
Example 2: Species count S 23; Total individuals N 486. Margalef index = 3.5563. Supporting values: Log of individuals ln N 6.1862; Menhinick index (comparison) 1.0433. Inputs: 23 species recorded among 486 individuals; Margalef's index corrects the raw count for sampling effort on a log scale. Log scale: ln(486) = 6.1862, and the numerator is S - 1 = 22. Division: 22 / 6.1862 = 3.5563; the Menhinick alternative, S / sqrt(N), would give 1.0433 for the same sample. Margalef result: 3.5563; values above about 5 usually indicate a rich, well-sampled community.
Example 3: Species count S 87; Total individuals N 9320. Margalef index = 9.4093. Supporting values: Log of individuals ln N 9.1399; Menhinick index (comparison) 0.9012. Inputs: 87 species recorded among 9,320 individuals; Margalef's index corrects the raw count for sampling effort on a log scale. Log scale: ln(9,320) = 9.1399, and the numerator is S - 1 = 86. Division: 86 / 9.1399 = 9.4093; the Menhinick alternative, S / sqrt(N), would give 0.9012 for the same sample. Margalef result: 9.4093; values above about 5 usually indicate a rich, well-sampled community.
What the index leaves out
Margalef counts species and individuals and nothing else: not evenness, not identity, not rarity. A sample of 48 species each represented evenly and a sample where one species supplies 90 percent of individuals receive the same index if S and N match. Diversity indices such as Shannon or Simpson exist precisely to capture the distribution Margalef ignores.
It is also only as good as the taxonomy underneath it. Splitting one variable species into three raises S and the index without any biological change, and samples identified by different workers to different resolutions are not comparable however elegant the correction. Standardise identification before standardising effort.
Margalef in practice
The index survives because it is computable from the two numbers every field survey records anyway. Rapid-assessment work — environmental impact surveys, fisheries bycatch logs, pollution monitoring — uses it as a first-pass richness gauge, with falling values along an effluent gradient triggering the expensive full analyses.
Used that way, as a screening statistic with its assumptions on the table, it remains genuinely useful nearly seventy years on. Used as a precise diversity measurement, it promises more than two counts can deliver.
Rarefaction, the stricter successor
Modern richness comparison usually reaches past both classic indices to rarefaction: given the species-abundance distribution of the larger sample, compute how many species it would be expected to show if it had only been sampled down to the smaller sample's size. The comparison is then between observed richness and a fair expectation at equal effort, with confidence intervals attached — everything Margalef gestures at, done explicitly.
Rarefaction's demands explain why the old index survives. It needs the full abundance distribution, not just S and N; historical datasets, fisheries logs and rapid surveys often preserve only the two totals. For those, Margalef remains the only correction computable at all, and a rough correction honestly labelled beats a raw count presented as comparable. The literature's long tail of S-and-N-only studies is exactly the niche this page serves.
There is also a forward-looking use: planning. If a pilot survey of 486 individuals returns a Margalef of 3.5563 and the study needs the precision of the 9,320-individual example, the gap between the two indices prices the additional fieldwork before it is commissioned. Indices that began as corrections end up as budgeting tools.
It is worth seeing the logarithm's mercy numerically. Take the smallest worked sample — 23 species among 486 individuals, index 3.5563 — and imagine the same community sampled ten times harder, finding, say, 31 species among 4,860 individuals. The raw count rises by a third, which looks like a discovery; the index moves only to 30 / ln(4,860) = 3.53, essentially unchanged, which is the truth: the community did not get richer, the net got bigger. Run the same trick on the first example and the index likewise holds near 6.59 while the species count inflates. That near-constancy under pure effort inflation is the entire justification for the formula, and testing a candidate index against it — does it stay put when only effort grows? — is a fair exam for any richness correction, including ones not yet invented.
Margalef himself would have recognised the limitation instantly: he spent his later career arguing that diversity is information, and that any single scalar — his own included — is a compression with losses. The index endures not because it captures a community but because it is honest about the two numbers it uses, reproducible from the summary line of any survey ever published, and wrong in ways its users can state precisely. In a field full of indices that demand data nobody collected, those are survival traits.
FAQs
What Margalef index does the first example give?
6.5911, from 48 species among 1,250 individuals: 47 divided by ln N of 7.1309.
What Menhinick value pairs with it?
1.3576 — a different scale entirely; only rankings within one index can be compared.
What index does the smallest sample give?
3.5563, from 23 species among 486 individuals.
How many species does the richest example hold?
87 species among 9,320 individuals, scoring 9.4091 even after the log discount.
Does the index stop growing with sample size?
No — it grows more slowly than the raw count, but larger samples still score higher; rarefaction is the stricter fix.
What does a single-species sample score?
Exactly 0, because the numerator S - 1 vanishes regardless of how many individuals were counted.