Skip to content
K Knidox Search…
Economics · Microeconomics

Gini Coefficient Calculator

Measure income inequality from each group’s income share, using the Lorenz curve and the trapezoid method.

Number of equal-population groups

Enter the share of total income held by each equal-sized group, ordered from the poorest group to the richest. Shares should add up to about 100 — if they don’t, they’re normalized automatically.

%
%
%
%
%
Gini coefficient
0.380moderate inequality

0 means perfect equality and 1 means one group holds all income. This distribution scores 0.380.

Lorenz curve — the gap from the diagonal is the inequality
Lorenz curve versus the line of perfect equality
Lorenz curve (actual)Line of equality— x-axis: cumulative population, y-axis: cumulative income.

The Gini coefficient measures income inequality on a scale from 0 (perfect equality, everyone earns the same) to 1 (perfect inequality, one person earns everything). For quintile income shares of 5%, 10%, 15%, 25%, and 45% from poorest to richest, the Gini coefficient is 0.380.

What the Gini coefficient measures

The Gini coefficient summarizes how unequally income (or wealth) is spread across a population in a single number. It is derived from the Lorenz curve: a graph plotting the cumulative share of income on the vertical axis against the cumulative share of the population — ordered from poorest to richest — on the horizontal axis. If everyone earned exactly the same, the poorest 20% would hold 20% of income, the poorest 40% would hold 40%, and so on, tracing a straight 45° diagonal called the line of perfect equality.

In reality the curve sags below that diagonal, because lower-income groups hold less than their proportional share. The Gini coefficient is the ratio of the area between the equality diagonal and the Lorenz curve to the total area beneath the diagonal. The wider that gap, the higher the Gini and the more unequal the distribution.

Gini = 1 − Σ (X_k − X_{k−1}) × (Y_k + Y_{k−1})

X is the cumulative population share and Y the cumulative income share (both as fractions 0–1). The sum runs over every segment of the Lorenz curve — the trapezoid method.

Worked example

Take five equal-population groups (quintiles) with income shares of 5%, 10%, 15%, 25%, and 45% from poorest to richest. Each group is 20% of the population, so the cumulative population shares are 0.20, 0.40, 0.60, 0.80, 1.00, and the cumulative income shares build up to 0.05, 0.15, 0.30, 0.55, 1.00.

  1. 1
    Order the groups and list their income shares. Sort the equal-population groups from poorest to richest: 5%, 10%, 15%, 25%, 45%. Check they sum to 100% (5 + 10 + 15 + 25 + 45 = 100); if not, divide each by the total to normalize.
  2. 2
    Build the cumulative population share (X). With five equal groups, each adds 0.20: the running totals are 0.20, 0.40, 0.60, 0.80, 1.00, starting from X₀ = 0.
  3. 3
    Build the cumulative income share (Y). Add the shares as fractions: 0.05, then 0.15, 0.30, 0.55, and finally 1.00, starting from Y₀ = 0.
  4. 4
    Apply the trapezoid method to each segment. For each step compute (X_k − X_{k−1}) × (Y_k + Y_{k−1}): 0.2×0.05 + 0.2×0.20 + 0.2×0.45 + 0.2×0.85 + 0.2×1.55 = 0.010 + 0.040 + 0.090 + 0.170 + 0.310 = 0.620.
  5. 5
    Subtract the sum from 1. Gini = 1 − 0.620 = 0.380 — a moderate level of income inequality.

Approximate Gini ranges and what they indicate

Rough, approximate bands for national income inequality — real published figures vary by source, year, and whether income is measured before or after taxes and transfers.

Gini rangeInterpretationRough real-world comparison
0.00Perfect equality — every group holds an identical share.Theoretical only.
≈ 0.25 – 0.30Relatively low inequality.Scandinavian and several Northern European economies (approx.).
≈ 0.30 – 0.40Moderate inequality.Many developed economies (approx.).
≈ 0.40High inequality.United States (approx.).
> 0.50Very high inequality.Some of the most unequal economies (approx.).
1.00Perfect inequality — one group holds all income.Theoretical only.

Reading the result

It captures the whole distribution in one number. That is the Gini’s strength and its weakness: two very different societies can share the same Gini if their Lorenz curves cross, because a single index can’t distinguish inequality at the bottom from inequality at the top. Pair it with the underlying shares or a percentile ratio when the shape matters.

Grouped data understates inequality. Computing the Gini from a handful of quintiles or deciles connects the Lorenz curve with straight lines, which slightly rounds off the curvature. The more groups you use, the closer the estimate gets to the value you would obtain from individual-level records — deciles are more precise than quartiles.

Definitions change the number. A Gini for market income (before taxes and government transfers) is typically higher than one for disposable income (after them). Always check what income concept and population a published Gini refers to before comparing figures across countries or years.

What is a Lorenz curve?
A Lorenz curve plots the cumulative share of income (vertical axis) against the cumulative share of the population from poorest to richest (horizontal axis). Perfect equality is a straight 45° diagonal; the more the actual curve sags below it, the more unequal the distribution. The Gini coefficient measures the size of that gap.
What does a Gini coefficient of 0 or 1 mean?
A Gini of 0 is perfect equality — every equal-population group holds an identical share of income, so the Lorenz curve lies exactly on the diagonal. A Gini of 1 is perfect inequality, where a single person or group holds all the income. Real economies fall in between, usually from about 0.25 to 0.65.
What Gini value is considered high?
As a rough guide, a Gini below about 0.30 is relatively low, around 0.30–0.40 is moderate, and above roughly 0.40 is high; values above 0.50 indicate very high inequality. These bands are approximate — the exact figure depends on the data source, the year, and whether income is measured before or after taxes and transfers.
How is the Gini coefficient calculated from grouped shares?
This tool uses the trapezoid method on the Lorenz curve: Gini = 1 − Σ (X_k − X_{k−1}) × (Y_k + Y_{k−1}), where X is the cumulative population share and Y the cumulative income share as fractions. It sums the trapezoid areas under the curve and subtracts the total from 1.
Do the income shares have to add up to 100?
They should, but they don’t have to. If your shares sum to something other than 100%, the calculator divides each by the total to normalize them first, and notes that it did so. What matters for the Gini is the relative shares between groups, not their absolute scale.
What are the limits of the Gini coefficient?
The Gini compresses an entire distribution into one number, so two societies with very different patterns can share the same value if their Lorenz curves cross — it can’t separate inequality at the bottom from inequality at the top. It is also sensitive to how income is defined and, with few groups, tends to understate inequality slightly.
Why do more groups give a more accurate Gini?
Grouped data connects the Lorenz curve with straight line segments, which cuts across its true curvature and slightly lowers the estimate. Using deciles (10 groups) traces the curve more finely than quartiles (4 groups), so the result lands closer to the value you would get from individual records.