EN

Gini coefficient calculator with Lorenz curve

Two countries can share the same average income and be entirely different societies: it all comes down to how that income gets distributed. The Gini coefficient compresses that distribution into a single number between 0 (everyone has exactly the same) and 1 (one person holds everything).

It's read off the Lorenz curve, which plots the cumulative share of the population on the horizontal axis against the cumulative share of wealth on the vertical axis. The further the curve bows away from the diagonal, the higher the concentration: Gini is precisely the ratio between the area of that gap and the area of the half-square.

The coefficient is scale-invariant: dollars, thousands of dollars, or percentages all give the same result. Either individual incomes or totals for equal-sized population groups (quintiles, deciles) may be entered. One caveat: grouped data smooths out the distribution within each group and always understates the true Gini a little.

The distribution to measure

List of values

One value per line (or separated by semicolons). The comma stays the thousands separator: 1,850.50 is read as a single number. No sorting is required beforehand, and the entry order makes no difference to the result.

0%50%50%100%100%ABcumulative populationcumulative valueG = A / (A + B)0.309i.e. 30.9%poorest 20%9.3%richest 20%41.7%S80/S20 ratio4.49Hoover index22.9%
Worked example (demonstration values): the Lorenz curve bows away from the diagonal in proportion to how unequal the distribution is. The figure redraws with the entered values after a calculation.

Starred terms on first mention are unpacked in the glossary at the end of the page.

How a Lorenz curve is drawn from a sorted list

A column of wages is not a picture of inequality. The Lorenz* curve is. Three mechanical steps, and the bow of the line does the talking.

  1. Sort the observations ascending — poorest first. Skip the sort and the formula is wrong; this calculator does it before anything else.
  2. Walk down the list. After k rows out of n, the point is (k/n of the population, the share of the total those k hold).
  3. Plot cumulative population on the x-axis, cumulative value on the y-axis, and join the dots. Start at (0, 0). Finish at (1, 1).

If every amount were identical, the curve would be the diagonal — the 45° line of perfect equality. The further it sags below that diagonal, the more of the total sits in the right-hand tail. A country, a payroll, a customer book: same drawing.

Ten wages already make a readable bow. Ten thousand refine it. The principle does not change with n.

Why G = 2A, and the trapezium rule that actually computes it

Call A the area between the diagonal and the Lorenz curve. Call B the area under the curve. The half-square under the diagonal is A + B = ½. Gini* is the share of that half-square taken by the gap.

G = A / (A + B) = A / (½) = 2A

G = 1 − 2B

Why 2A, not A? A alone maxes out at ½ — one person holds everything, the curve hugs the axes. Doubling maps that onto the 0-to-1 scale everyone quotes.

In practice A is never “painted”. Trapeziums are stacked under the Lorenz curve. Each slice is a pair of neighbouring points, area (Fk − Fk−1) × (Lk + Lk−1) / 2. Then G = 1 − 2 × (sum of those areas). Same number as 2A, reached from the other side of the square. The figure on this page and the coefficient are not two opinions. They are one calculation, drawn and then printed.

Rank formula, mean difference, trapeziums: one Gini, three identities

Three writings. One coefficient. That holds on ungrouped individual data, sorted.

G = 2 · Σ(i · xi) / (n · Σxi) − (n + 1) / n  (ranks, values sorted ascending)

G = Σi Σj |yi − yj| / (2 n2 μ)  (mean absolute difference)

G = 1 − 2 · Σk (Fk − Fk−1) · (Lk + Lk−1) / 2  (trapeziums on the Lorenz curve)

The rank form is the one this calculator uses — a close cousin of G = Σ(2i − n − 1) yi / (n2 μ). Pairwise absolute differences make the same idea blunt: Gini is the average gap between two random people, scaled by twice the mean. Trapeziums are the picture.

They agree because they are identities, not rivals. Grouped data, extra weights, a different interpolation, and they can start to drift. That is a data problem, not a quarrel among formulas.

Decile tables understate: how far grouped data miss the mark

Ten decile* totals look tidy. They also lie a little. Inside each decile, people are not identical, and the Lorenz curve of the true microdata bows further than the polyline that joins ten group means. Treating each group as a single point therefore understates Gini. Coarser groups, larger understatement.

On decile data the bias often runs to 2 to 3 Gini points — 0.03 on the 0-to-1 scale, enough to swap two countries in an OECD league table. Quintiles are worse. Individual records, or very fine bins, are better.

This form will swallow either: a list of 10,000 wages, or five quintile totals. Grouped figures are a lower bound. Equal-sized groups (true quintiles, true deciles) at least keep the x-axis honest. Unequal bins need weights, or a second mistake sits on top of the first.

Crossing curves, identical Gini: the shape the coefficient cannot see

One number cannot see a shape. Two Lorenz curves can cross, post the same G, and describe different countries.

A squeezed middle with a thin poor tail and a thin rich tail, against a mass of modest incomes and a handful of billionaires. The areas A can match. The politics will not. Gini is also silent on who sits where: age, region, tenure, ethnicity, a coastal town versus a former pit village. A rise driven by pensions is not a rise driven by City bonuses. The coefficient will not say which.

That is not a reason to throw Gini out. It is a reason to keep the curve, the quintile table, and at least one other ratio next to it. This page already prints those on purpose.

S80/S20, Palma ratio, Theil and Atkinson

When the single number is not enough — and it often is not — the usual toolkit is small. This calculator already returns three of the ratios; Theil* and Atkinson* need a different formula.

  • S80/S20 — total income of the top 20% divided by the bottom 20%. A ratio of shares, easy to put in a briefing.
  • D9/D1 — the ninth-decile threshold over the first. Not shares, cut-offs: the person at 90% earns this many times the person at 10%.
  • Palma ratio* — top 10% share over bottom 40% share. Built on the observation that the middle 50% is oddly stable across many countries, so the action is at the two tails. Common on OECD and developing-country tables.
  • Theil — decomposable into “within groups” and “between groups”. Gini is a nuisance to split that way; Theil is not.
  • Atkinson — a family, not a point. An inequality-aversion parameter leans the index toward the bottom of the distribution as that parameter rises.

S80/S20 for a sentence. Palma ratio when the top and the bottom are the story. Theil when the question is regions versus households inside regions. Hoover, printed here too, is the share of the total that would have to change hands to reach equality — 0.15 means 15% of the mass to move.

Original income versus equivalised disposable income

Which income? The answer moves Gini by more than most year-to-year “inequality has risen” headlines.

  • Original (market) income — wages, self-employment, rent, dividends, before tax and before benefits. High Gini. The market’s distribution.
  • Disposable income — after income tax, National Insurance, and cash transfers. Lower Gini. What households can actually spend.

The drop between those two is a measure of redistribution. Across European countries it often knocks 15 to 30 percentage points off Gini — 0.15 to 0.30 on the coefficient. Cash benefits do a lot of the work at the bottom; income tax does it at the top. In-kind services (NHS, schools) sit outside most headline series, so the “after redistribution” Gini still understates the equalising effect of a welfare state that pays in services rather than in cash.

Name the income concept. “The UK Gini is 0.35” is not a fact until the series is original, gross, or equivalised disposable. Original income also carries unemployment: an ILO unemployed person contributes a zero, or a near-zero, to the wage bill. The unemployment rate measures access to work. Gini measures how the amounts paid out are shared. Two questions.

Income Gini versus wealth Gini

Wealth is more concentrated than income. Always, everywhere it is measured well. Income is a flow. Wealth is a stock that inherits, compounds, and sits in houses and pensions.

  • Disposable income Gini in Europe: about 0.22 (Slovakia) to 0.38 (Bulgaria), Eurostat.
  • United States, income: around 0.40.
  • Wealth Gini in Europe: roughly 0.55 to 0.70.
  • United States, wealth: around 0.80 before tax.

That gap is inheritance, the return on a large pile, and the simple fact that many households have almost no net wealth while a few have almost all of it. A country can look “Nordic” on income and much less Nordic on housing and financial assets. An income Gini is not a wealth story. The wealth figure being twice as large is the normal case, not a contradiction.

Gini as a concentration index: clients, market shares, traffic

Nothing in the formula says “income”. Any list of non-negative amounts will do, and firms use it as a concentration index without ever saying “inequality”.

  • Customers — revenue per account. A Gini near 1 is a Pareto book: a handful of clients, a nervous sales director. Near 0 is a long tail of similar tickets.
  • Lending or assets — how much of the book sits in the largest exposures. Complements a Herfindahl on names.
  • Web traffic — sessions or revenue by URL or by user. A few pages doing all the work is a Gini that can be plotted.
  • Market shares — close in spirit to a Herfindahl–Hirschman index, with a picture attached.

Scale invariance is the gift here: pounds, thousands, or percentages of a total all give the same G. Paste the column in and compare two years of the same book. A 0.60 Gini on household incomes is a very unequal society. A 0.60 Gini on a shop’s ticket sizes is an ordinary retail book. Same number. Different stake.

OECD-modified equivalence and survey weights

A couple and a family of five with the same household income are not equally well off. Compare them raw and the family looks poorer than a per-person view would, or richer than an unadjusted household view would — depending which mistake is picked.

The usual fix is an equivalence scale*. The OECD-modified scale — the ONS default in many UK tables — counts 1 for the first adult, 0.5 for each extra adult, 0.3 for each child. Income is then analysed per consumption unit, or each household is weighted by its number of units so that a large household counts for more people. Survey data add a second weight: the sampling weight that makes the sample look like the population. The weighted Gini replaces each person with that weight inside the rank or pairwise formula.

This calculator treats each line as one equally weighted observation. Households of different sizes need equivalisation first, then the paste. Two weights, often: the scale, and the survey weight. Dropping either bends the curve.

Bootstrap intervals on a sample Gini

A Gini from a sample is an estimate. The true population figure sits somewhere around it, and “somewhere” can be uncomfortably wide on a small survey with a fat tail.

The workhorse interval is a bootstrap:

  1. Draw, with replacement, a sample the same size as the original. Repeat N times (a thousand is a common start).
  2. Compute G on each draw.
  3. Read the 2.5% and 97.5% quantiles of those G’s. That is a 95% interval, of a sort.

Width grows when n is small, when the distribution is wild, and when more confidence is asked. A 0.01 move in Gini year-on-year is often inside the interval. Publishing it as a “rise in inequality” without the interval is how briefing notes come unstuck. This form gives the point estimate for the list typed. The interval is extra work on the same list.

Two countries, same mean, different Lorenz curves

Two imaginary countries. Same mean household income: £30,000. Completely different places to live.

  • Country A — top 20% take 50% of total income, bottom 20% take 5%.
  • Country B — top 20% take 35%, bottom 20% take 10%.

Representative lists in the rank formula land near G ≈ 0.45 for A (high inequality) and G ≈ 0.28 for B (moderate). The means matched. The Lorenz curve for A hangs well below B’s. Average income, on its own, said nothing about that. A mean is a total divided by a headcount. It cannot see a tail.

That is the whole point of this page. Type both distributions. Keep the mean still. Watch G, the Palma ratio and the curve move. A third country C can share A’s 0.45 with a Lorenz that crosses A’s. Hence the habit: mean, Gini, and a look at the quintiles.

What the ONS actually publishes

The Office for National Statistics is the UK source, not a blog’s screenshot of a US Census figure. The headline household series is usually equivalised disposable income, before and after housing costs, from the Household Finances Survey and its predecessors. The ONS also publishes a Gini for original income, gross income, and disposable income, which is how redistribution is watched without mixing concepts.

UK disposable-income Gini has spent most of the last two decades in a band around the mid-30s on the 0-to-100 scale the ONS likes (0.32 to 0.36 or so on the 0-to-1 scale this calculator uses). That sits above Slovakia’s 0.22 and below the US figure around 0.40 — a North European welfare state with an Anglo-Saxon tail, in one sentence. Regional breakdowns (London versus the North East) and tenure splits often move more than the national Gini, which is why the national number can look “stable” while a city does not.

ONS Gini is a survey estimate, revised, and sensitive to the top tail. A handful of very high incomes, or a change in how they are modelled, can move the second decimal. Compare like with like: same income definition, same year, same “before/after housing costs” choice.

Tax, National Insurance and Universal Credit: how far the UK Gini moves

Original-income Gini in Britain is much higher than the disposable figure. Income tax and National Insurance pull the top down; Universal Credit, the State Pension, and disability benefits lift the bottom. The gap between those two Ginis is the UK’s cash-redistribution story, and it sits in that European 15-to-30-point range — closer to the middle than to the wildest cuts.

Universal Credit replaced a tangle of working-age benefits with one taper. That changes who is in the bottom quintile more than it always changes Gini: a smoother taper can raise measured incomes just above the floor without shrinking the top. Council Tax Reduction, housing support, and the benefit cap sit in the same machinery. A “benefits uprating” that matches inflation may hold real incomes flat and yet let Gini drift if market wages at the top run ahead.

To mimic an ONS table, paste equivalised disposable incomes, not headline salaries. A £45,000 wage and a £45,000 disposable income are not the same row. A rise in the ILO unemployment rate first fattens original-income Gini; Universal Credit claws some of that back on the disposable series. Reading both Ginis next to the unemployment rate stops a cycle being sold as a reform.

Housing wealth, Council Tax bands, and the figure the income Gini hides

Most UK household wealth is a house plus a pension. The income Gini never sees either, except as a flow of imputed rent or a pension payment much later. Wealth Gini is therefore the figure that captures “who owns the street”. It is a lot higher, in line with that 0.55 to 0.70 European wealth band, and it is regional in a way income is not: owner-occupation in the South East versus a rented flat in a cheap year.

Council Tax is still levied on 1991 bands. A Band D in Durham and a Band D in Kensington are not the same asset. The tax is a small, lumpy charge on a dwelling, not a proportional wealth tax, so it barely touches the wealth Gini. Two households with the same income, one owning a paid-off house, one renting, look alike in an income Lorenz curve and nothing alike in a wealth one.

A UK inequality conversation that only quotes income Gini is talking about half the furniture. Run this calculator twice: once on incomes, once on net wealth if the list exists. The second curve is the one that usually sags.

Glossary

Lorenz curve
A plot of the population lined up from poorest to richest, showing at each step what share of the total those people already hold. The 45° diagonal would be perfect equality.
Gini coefficient
A number between 0 and 1 that summarises how far that curve sits from the diagonal. 0 means everyone has the same amount. 1 means one person holds everything.
Decile
A tenth of the population once it has been ranked. The first decile is the poorest 10%. The D9 cut-off is the income above which the richest 10% begin.
Palma ratio
The share of the total held by the top 10%, divided by the share held by the bottom 40%. The middle of the distribution is left out on purpose: it often barely moves.
Theil index
Another inequality measure, useful because it splits cleanly: inequality between groups plus inequality inside those groups (regions, occupations, and so on).
Atkinson index
A family of indices with a knob for how much the bottom of the scale should weigh. Turn that parameter up and the same list looks more unequal.
Equivalence scale
A household count that allows for shared costs. The OECD-modified scale (ONS default in many UK tables) gives 1 to the first adult, 0.5 to each extra adult, 0.3 to each child. Household income divided by that total is income per consumption unit.

Related calculators