Gini Coefficient Calculator

Gini coefficient—
Income share of poorest 40%—
Income share of richest 20%—
Inequality level—

How Gini Coefficient Calculator is calculated: Gini = 1 − 2 × area under the Lorenz curve, estimated by trapezoids from the five quintile income shares

What is the Gini coefficient?

The Gini coefficient measures income inequality on a scale from 0 to 1. A coefficient of 0 means perfect equality, where everyone earns the same, and a coefficient of 1 means perfect inequality, where one person earns everything. With income shares of 8%, 12%, 16%, 22%, and 42% for the five quintiles, the Gini coefficient is 0.31, which is moderate inequality.

The coefficient comes from the Lorenz curve, which plots the cumulative share of income against the cumulative share of the population. In a perfectly equal society, the curve is a straight diagonal line: the poorest 20% earn 20% of the income, the poorest 40% earn 40%, and so on. In an unequal society, the curve sags below the diagonal, and the Gini coefficient measures how far it sags.

The coefficient is used by governments, the World Bank, and researchers to compare inequality across countries and over time. A country with a Gini of 0.25 is more equal than one with 0.45, and a country whose Gini rises from 0.3 to 0.35 over a decade is becoming more unequal, whatever its GDP is doing.

This calculator estimates the Gini from quintile income shares, the five groups of 20% of the population. It is an approximation: the official Gini uses the full income distribution, not just five numbers, so the result is close to the official figure but not identical. The article explains the method and its limits.

How the Gini coefficient formula works

The formula measures the area under the Lorenz curve. With shares of 8%, 12%, 16%, 22%, and 42%, the cumulative income shares are 0, 0.08, 0.20, 0.36, 0.58, and 1.00, at population shares of 0, 0.2, 0.4, 0.6, 0.8, and 1.00. The area under the curve is found by trapezoids: the five segments give areas of 0.008, 0.028, 0.056, 0.094, and 0.158, which add up to 0.344.

The Gini coefficient is 1 minus twice that area: 1 minus 0.688 is 0.31. In a perfectly equal society, the area under the diagonal is 0.5, so the Gini is 1 minus 1, which is 0. In a perfectly unequal society, the area is 0, so the Gini is 1. The coefficient is always between those two extremes.

The bottom 40% share is the first two quintiles added together: 8 plus 12 is 20%, so the poorest 40% of the population earn 20% of the income. The top 20% share is the last quintile: 42%. The gap between 20% and 42% is the inequality in one glance. A percentage calculator can check the cumulative shares by hand if you want to verify a result.

Quintile shares: the numbers people get wrong

The most common error is entering shares that do not add up to 100%. The five quintiles cover the whole population, so their income shares must total 100%. Shares of 8, 12, 16, 22, and 42 add up to exactly 100, and if yours do not, one of them is wrong, or the data comes from different sources.

The second error is using wealth shares instead of income shares. Wealth is far more unequal than income, because the rich own assets as well as earning income, so a Gini calculated from wealth shares will be much higher than one from income shares. The two must not be mixed, and this calculator uses income shares.

The third error is forgetting that quintiles are population groups, not income groups. The poorest 20% are the poorest fifth of the people, whatever they earn, and their share is the share of total income that fifth receives. The groups are defined by ranking people, not by income bands.

The fourth error is treating the quintile estimate as exact. The official Gini uses the full distribution, with thousands of data points, and the quintile method with five points gives an approximation that is usually within a few hundredths of the official figure. It is good enough for comparison, but not for publication.

A worked example: shares 8%, 12%, 16%, 22%, 42%

Take the default example on this page. The quintile income shares are 8%, 12%, 16%, 22%, and 42%. The cumulative shares are 0.08, 0.20, 0.36, 0.58, and 1.00. The trapezoid areas are 0.008, 0.028, 0.056, 0.094, and 0.158, which add up to 0.344. The Gini coefficient is 1 minus 2 times 0.344, which is 0.31. The bottom 40% share is 20%, and the top 20% share is 42%. The inequality level is moderate.

Now a second case: shares of 5%, 10%, 15%, 25%, and 45%. The cumulative shares are 0.05, 0.15, 0.30, 0.55, and 1.00. The trapezoid areas are 0.005, 0.02, 0.045, 0.085, and 0.155, which add up to 0.31. The Gini coefficient is 1 minus 0.62, which is 0.38. The bottom 40% share is 15%, and the top 20% share is 45%. The inequality is higher, though still moderate.

Now a third case: equal shares of 20% each. The cumulative shares are 0.20, 0.40, 0.60, 0.80, and 1.00, which is the diagonal itself. The area under it is 0.5, so the Gini is 1 minus 1, which is 0. The bottom 40% share is 40%, and the top 20% share is 20%. Perfect equality gives a Gini of exactly zero.

Who uses a Gini coefficient calculator

Economics students use it to learn the Lorenz curve. The formula is the first thing taught about inequality, and the calculator turns the quintile shares into the coefficient, so the student can see how the curve, the area, and the number are linked.

Researchers use it to compare countries. A country with a Gini of 0.31 is more equal than one with 0.38, and the difference is visible in the bottom 40% share: 20% against 15%. The calculator gives the comparison in one number, though the full distribution tells a richer story.

Policymakers use it to track change. A Gini that rises from 0.31 to 0.38 over a decade says inequality is growing, whatever GDP is doing, and the policy response depends on whether the change came from the top gaining or the bottom losing.

Journalists use it to explain inequality. A CAGR calculator can show the growth rate of the top share, and the Gini turns that growth into a single number that readers can compare across countries and years.

Gini coefficient vs income share: what is different

The Gini coefficient is a single number summarising the whole distribution, while the income shares are the raw data. A Gini of 0.31 and a top 20% share of 42% describe the same society, but the Gini is easier to compare across countries, and the shares are easier to understand. The two are linked: the shares determine the Gini, and the Gini summarises the shares.

Use the Gini to compare inequality across countries or over time, and the shares to see where the inequality sits. Two countries can have the same Gini with different shapes: one where the top is very rich, and one where the bottom is very poor. The shares show which one it is.

The Gini also hides the middle. A society where the middle 60% earn very little and the top and bottom are equal can have the same Gini as one where the middle is comfortable. The shares, especially the middle ones, reveal what the single number cannot.

Common Gini coefficient mistakes

The first mistake is treating the Gini as a measure of poverty. A poor country can have a low Gini, because everyone is equally poor, and a rich country can have a high Gini, because some are very rich. Inequality and poverty are different things, and the Gini measures only the first.

The second mistake is comparing Gini figures from different sources. The World Bank, the OECD, and national statistics offices use different income definitions, before or after tax, and with or without transfers, so their Gini figures for the same country can differ by several hundredths. Compare figures from the same source.

The third mistake is ignoring the quintile approximation. The official Gini uses the full distribution, and the quintile method gives an estimate that is usually close but not exact. A quintile Gini of 0.31 could correspond to an official figure anywhere from about 0.29 to 0.33, so do not over-interpret small differences.

The fourth mistake is assuming a falling Gini is always good. A Gini can fall because the rich got poorer, not because the poor got richer, and a falling Gini during a recession is not a success. Look at the shares as well as the coefficient, to see who actually gained.

How to use this Gini coefficient calculator

Enter the income shares of the five quintiles, from the poorest 20% to the richest 20%, as percentages that add up to 100%. The results update instantly: the Gini coefficient, the bottom 40% share, the top 20% share, and the inequality level. Use income shares from the same survey and the same year.

Compare countries or years by entering each set of shares in turn and noting the Gini. A ROI calculator is not needed here, but a table of the shares is: write the five shares down next to the Gini, so the shape of the inequality is visible alongside the single number.

Everything runs in your browser. No account, no sign-up, no data sent anywhere. Your figures never leave your device. Run it with survey data, compare the Gini with the shares, and remember that one number can summarise inequality but cannot explain it.

Frequently Asked Questions

It means moderate income inequality. The scale runs from 0, perfect equality where everyone earns the same, to 1, perfect inequality where one person earns everything. A Gini of 0.31, from shares of 8%, 12%, 16%, 22%, and 42%, means the poorest 40% earn 20% of the income while the richest 20% earn 42%.

The Lorenz curve plots the cumulative share of income against the cumulative share of the population. In a perfectly equal society it is a straight diagonal line. In an unequal society it sags below the diagonal, and the Gini coefficient is 1 minus twice the area under the curve. The further the curve sags, the higher the Gini.

Not necessarily. A higher Gini means more inequality, but it says nothing about poverty: a poor country can have a low Gini because everyone is equally poor. A Gini can also fall because the rich got poorer rather than because the poor got richer. Look at the income shares as well as the coefficient to see who actually gained or lost.

Because it uses five numbers, the income shares of the five quintiles, while the official Gini uses the full income distribution with thousands of data points. The quintile method with trapezoids is usually within a few hundredths of the official figure, which is good enough for comparison, but not exact enough for publication.

More free tools

More calculators and utilities from Sortrun — free, no sign-up.