Gini Coefficient Calculator
Measure income inequality from each group’s income share, using the Lorenz curve and the trapezoid method.
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.
0 means perfect equality and 1 means one group holds all income. This distribution scores 0.380.
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.
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 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 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 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 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 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 range | Interpretation | Rough real-world comparison |
|---|---|---|
| 0.00 | Perfect equality — every group holds an identical share. | Theoretical only. |
| ≈ 0.25 – 0.30 | Relatively low inequality. | Scandinavian and several Northern European economies (approx.). |
| ≈ 0.30 – 0.40 | Moderate inequality. | Many developed economies (approx.). |
| ≈ 0.40 | High inequality. | United States (approx.). |
| > 0.50 | Very high inequality. | Some of the most unequal economies (approx.). |
| 1.00 | Perfect 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.