Math calculator

Gini Coefficient Calculator

Inequality, and where it actually sits.

Inequality, in one number

Five people with nothing and five sharing equally. Gini exactly 0.50000000. The bottom 50% hold 0.000000 of the total and the Palma ratio is infinite — there is no bottom 40% to divide by.

10 values, total 500.0000, mean 50.0000

Gini = 0.50000000

The top 10% hold 20.0000% and the bottom 50% hold 0.0000%. The Palma ratio — top 10% over bottom 40% — is infinite, because the bottom 40% hold nothing. Those share figures say where the inequality actually sits, and the Gini on its own cannot.

Gini

0.500000

max for n = 10 is 0.9000

Top 10% share

20.000%

top 20%: 40.00%

Bottom 50% share

0.000%

what the Gini hides

Palma ratio

top 10% ÷ bottom 40%

The Lorenz curve

00.5100.51cumulative share of the populationcumulative share of the total
The Lorenz curve as a table of cumulative shares
Cumulative populationCumulative shareGap from equality
10.0%0.0000%10.0000 pp
20.0%0.0000%20.0000 pp
30.0%0.0000%30.0000 pp
40.0%0.0000%40.0000 pp
50.0%0.0000%50.0000 pp
60.0%20.0000%40.0000 pp
70.0%40.0000%30.0000 pp
80.0%60.0000%20.0000 pp
90.0%80.0000%10.0000 pp
100.0%100.0000%0.0000 pp

The first two presets have a Gini of exactly 0.50000000 and could hardly be more different: one has half the population with nothing, the other has no poverty at all and one rich person. Their Lorenz curves cross, which is precisely the case a single area cannot distinguish.

Scale-free: doubling every income changes nothing Maximum is (n−1)/n, not 1, for a finite population Blind to where in the distribution the gap sits

What this tool shows

Two distributions with a Gini of exactly 0.50000000: one where half the population has nothing, and one where nobody is poor and a single person earns 13.5 times the rest. In the first the bottom 50% hold 0.000000 of the total; in the second, 0.222222. The Lorenz curves cross, which is precisely the case one enclosed area cannot distinguish — so the tool prints the share figures beside the coefficient.

  • The Gini coefficient, computed from the sorted values rather than by integrating a curve
  • The full Lorenz curve, plotted and tabulated against the equality diagonal
  • Top 1%, 10% and 20% shares, and the bottom 50% share
  • The Palma ratio and the 20:20 quintile ratio, which the Gini cannot express
  • The maximum a finite population can reach — (n−1)/n, never 1
  • Scale invariance: multiplying every value changes nothing
Lorenz curve Share breakdown Palma and 20:20 Scale-free

Two very different societies can share a Gini exactly.

Updated 13 September 2026 · Works in any browser, no installation

The Gini coefficient is twice the area between the Lorenz curve and the line of perfect equality. It runs from 0, where everyone has the same, to a maximum of (n−1)/n for a population of n. It is a single number summarising a whole curve — which makes it comparable across countries and years, and blind to which part of the distribution the inequality lives in.

At a glance

Formula shown
With the values sorted ascending, G = (2·Σ i·xᵢ − (n+1)·Σ xᵢ) / (n·Σ xᵢ). Equivalently it is the relative mean absolute difference halved: the average absolute difference between every pair of values, divided by twice the mean. Because the total appears in both numerator and denominator, multiplying every value by any positive constant leaves G exactly unchanged.
Scenario support
Income and wealth inequality, market-share concentration, the spread of revenue across customers or products, load imbalance across servers, citation or download concentration, and any question of the form "how unevenly is this total shared out?".
Educational estimate
Planning support from the values you enter — not professional advice.

One area, many curves

The Gini reduces an entire Lorenz curve to the area it encloses. Different curves can enclose the same area, and the tool’s first two presets are as different as two curves get.

Five people with nothing and five sharing equally: Gini 0.50000000. The bottom 50% hold 0.000000 of the total and the Palma ratio is infinite, because there is no bottom 40% to divide by.

Nine people equal and one with 13.5× their income: Gini 0.50000000. Identical to eight decimal places. The bottom 50% hold 0.222222, the top 10% hold 0.600000, and the Palma ratio is 3.3750.

Those are not variations on one society. One has mass poverty and no rich; the other has no poverty and one rich person. Any policy response to them would differ completely.

Their Lorenz curves CROSS, which is the formal condition under which no single-number inequality measure can order two distributions consistently. When curves do not cross, every reasonable measure agrees; when they do, the choice of measure decides the answer.

Which is why the share table is on the page and not behind a link. “Gini 0.50” is one number; “the bottom half hold nothing” is the finding.

It cannot reach 1, and the ceiling depends on n

The textbook range is 0 to 1. The upper end is unreachable for any finite population, and the gap is large when n is small.

Maximum inequality is one person holding everything, which gives a Gini of exactly (n−1)/n. With ten people that is 0.90000000 — the tool’s fourth preset reaches it exactly.

With five people the ceiling is 0.8; with a hundred, 0.99. Only in the limit does it approach 1.

Which matters when comparing small groups. A Gini of 0.75 among five regions is 94% of the achievable maximum; the same 0.75 across a million households is nothing like as extreme.

Some software applies an n/(n−1) correction to rescale to a full 0-to-1 range, which makes small-sample values comparable and makes them incomparable with uncorrected figures. This tool reports the uncorrected coefficient and prints the ceiling beside it.

The Palma and 20:20 ratios say what the Gini will not

Both are deliberately cruder than the Gini and both carry information it discards, which is the trade worth understanding.

The Palma ratio is the top 10% over the bottom 40%. It ignores the middle entirely, on the empirical observation that the middle 50% take a remarkably stable share across countries — so all the variation is at the two ends.

The 20:20 ratio is the top quintile over the bottom quintile, and is the one most readable to a non-specialist: “the richest fifth have seven times the poorest fifth”.

Neither is scale-free in the Gini’s sense of using every observation, which makes them noisier on small samples and far more interpretable on large ones.

Both go infinite when the bottom holds nothing, which the tool reports rather than suppressing — an infinite Palma is a real statement about a society, and the Gini’s 0.50 for the same data is not.

The Gini is most sensitive to the middle

This is a mathematical property rather than a design choice, and it runs against what most people assume the measure is for.

A transfer between two people changes the Gini in proportion to how many people sit between them in the ranking. So a transfer across the middle of the distribution moves it most.

Changes at the very top move it least. A billionaire doubling their wealth barely moves a national Gini, because only a handful of people are ranked above or below them.

Which is the opposite of what most commentary assumes, and the reason top-share measures — the top 1% share, the Palma — have become the preferred instruments for questions about concentration at the top.

The Gini is also undefined for negative values, so wealth data with debts needs a different treatment: this tool refuses negative inputs rather than silently producing a coefficient above 1.

What the data has to be for the number to mean anything

Most disagreements about a published Gini are disagreements about its input, not its arithmetic.

Income before or after tax and transfers gives very different answers. Market-income Ginis run far above disposable-income Ginis in every developed country, and comparing one with the other is the commonest error in cross-country tables.

The unit matters: individuals, households or equivalised households. A household of four with one income is not four people with a quarter each, and equivalisation scales are a modelling choice.

Wealth Ginis are always higher than income Ginis, typically by 0.2 to 0.3, because wealth accumulates and can be zero or negative for a large share of people.

Top incomes are systematically under-captured by surveys, so survey-based Ginis understate inequality relative to tax-record ones — and the gap has grown.

Grouped data gives a lower Gini than the underlying microdata, because within-group variation vanishes. A Gini computed from decile averages is a lower bound, not an estimate.

Reporting a Gini coefficient

Four things, and the second is the one this page exists to argue for.

Say what was measured and on whom. Pre-tax or post-tax, individual or household, income or wealth — without those the number is not comparable to anything.

Give at least one share figure beside it. The bottom 50% share or the Palma ratio takes one line and is what distinguishes two societies with the same Gini.

Give n, especially for small populations. The ceiling is (n−1)/n and it matters below a few hundred.

And say whether the data was grouped. A Gini from decile averages is a lower bound on the Gini from the underlying records, and the two are routinely quoted side by side as if equivalent.

Sources and methodology

References for the Gini coefficient and its alternatives.

Method. The coefficient is computed directly from the sorted values — (2·Σi·xᵢ − (n+1)·Σxᵢ)/(n·Σxᵢ) — rather than by numerically integrating the Lorenz curve, so there is no quadrature error and the shipped presets land on 0.50000000 exactly rather than approximately. That exactness is what makes the central claim checkable: two distributions with the same coefficient to eight decimal places, whose Lorenz curves cross, and whose bottom-50% shares are 0.000000 and 0.222222. The suite asserts the coefficient is invariant to scaling every value, that it equals exactly (n−1)/n when one holder has everything, and that it is exactly 0 when all values are equal. Negative values return no result rather than a coefficient above 1. Fewer than two values, and a total of zero, also return no result. That engine is verified on every change against 100 assertions. The count and the per-case breakdown are published on the formula verification page.

Related calculators

Where this goes next:

Herfindahl IndexHHI with each firm's contribution, the numbers-equivalent and the exact merger delta: merging the top two adds precisely 2 x s1 x s2, whatever else is in the market.
Shannon EntropyEntropy in bits, nats and bans with per-symbol contributions, efficiency and perplexity — and the demonstration that a sorted sequence and its shuffle give identical values to the last bit.
PercentileThe value at any percentile and the percentile rank of any value, with all nine standard methods — and the round trip that shows the two directions are not inverses.
QuartileQ1, Q2 and Q3 by all eleven conventions in common use — Excel, R, Tukey hinges and the TI-84 rule — with a warning when they disagree.
Coefficient of VariationRelative standard deviation with the scale trap made visible — the same five temperatures give a CV of 22.6%, 41.6% or 3.0% depending on the unit, because only a true zero makes the ratio mean anything.
Mean Absolute DeviationAll three statistics the acronym MAD names — about the mean, about the median, and the median absolute deviation — plus the ratio to the standard deviation, which is exactly 0.7979 for a normal distribution and so reads as a free shape check.

More in Math, or browse all calculators.

Educational use disclaimer

An educational tool. The Gini coefficient summarises an entire Lorenz curve as one number, so two distributions with crossing curves can share a coefficient exactly while differing completely in where the inequality sits — the share figures beside it are what distinguish them. It is also undefined for negative values and is a lower bound when computed from grouped data.

How we calculate · Found an error? email us

Authorship & verification

Written and maintained by , a business operator who builds spreadsheet-based calculators.

What's changed (5 updates)

Published 13 September 2026

  1. Published a Gini tool with the full Lorenz curve plotted and tabulated, plus the top and bottom shares, the Palma ratio and the 20:20 quintile ratio.
  2. Built it on a pair that settles what a single number can and cannot say: [0,0,0,0,0,100,100,100,100,100] and [1,1,1,1,1,1,1,1,1,13.5] both have a Gini of EXACTLY 0.50000000. In the first the bottom 50% hold 0.000000 and the Palma ratio is infinite; in the second they hold 0.222222 and the Palma is 3.3750. Their Lorenz curves cross, which is the formal condition under which no single-number measure can order two distributions.
  3. Computed the coefficient directly from the sorted values rather than by integrating the curve, which is why the presets land on 0.50000000 exactly rather than approximately.
  4. Printed the ceiling beside the value: the maximum for n holders is (n−1)/n, so 0.90000000 is the most ten people can reach and a Gini of 0.75 among five units is 94% of what is achievable.
  5. Recorded that the Gini is most sensitive to transfers in the MIDDLE of the distribution and least sensitive at the top — which is the opposite of what most commentary assumes, and the reason top-share measures have displaced it for concentration questions.

Add this calculator to your site

Responsive embed — and private: nothing your visitors type leaves their browser.