Advertisement
Advertisement
ECONOMICS

Gini Coefficient Calculator — inequality from your own distribution

Paste a list of incomes, wealth holdings or group averages and get the Gini coefficient, the Lorenz curve, and the top and bottom shares that produced it.

One value per line, or separated by commas or spaces. These can be individual incomes, group averages, or quintile totals — the Gini is scale-free, so the currency and unit do not matter.
This label does not change the arithmetic, but it changes what the number means. A Gini on market income and one on disposable income are not comparable.
Applies to the coefficient and the cumulative shares. Internal arithmetic is full precision.
Gini coefficient
 
Gini index (0–100 scale)
Share held by the top unit
Share held by the bottom unit
Top to bottom ratio
Working:
Tip: the bars show the Lorenz curve — the cumulative share of the total held by the poorest fraction of units. Under perfect equality every bar sits exactly on its own population share, and the gap between the two is what the Gini measures.
Advertisement

The Gini coefficient calculator above takes a list of values you supply, sorts them, builds the Lorenz curve and returns the Gini coefficient on the standard zero-to-one scale, along with the Gini index on the zero-to-one-hundred scale that most statistical agencies publish. It also reports the top and bottom shares, because those two numbers frequently explain a Gini figure that otherwise looks inscrutable.

Arb Digital publishes no inequality data here. The Gini coefficient is a summary statistic — a defined operation on a distribution — not an observed quantity, and every published national figure depends on choices about the survey, the unit of analysis and the income concept that the coefficient itself cannot express. Everything in the boxes is a placeholder for figures you take from your own national statistics office or a published dataset. If you need output totals rather than their distribution, our GDP calculator handles the national accounting side.

What This Gini Coefficient Calculator Does

It reads any list of non-negative numbers, sorts them ascending, and applies the standard sorted-observation formula for the Gini coefficient. It then constructs the cumulative shares that define the Lorenz curve and displays them as bars, so you can see the shape of the distribution rather than only its summary.

The tool works equally well on individual observations and on grouped data. If you paste five quintile averages, you get the between-group Gini — the inequality that would exist if everyone inside each quintile had that quintile's average. That figure is always lower than the true Gini computed from individual records, because grouping discards the variation inside each group. The tool says so in its working line rather than letting you assume the two are the same.

Negative values are rejected with a written explanation. Negative incomes are real — a self-employed household can post a loss in a bad year — but the Lorenz curve is not well defined when the cumulative total can fall, and the standard formula returns a coefficient above one, which is not interpretable. Agencies handle this by bottom-coding at zero or by using a different index entirely, and this tool asks you to decide rather than deciding for you.

How to Use It

  1. Paste your values one per line. They can be incomes, wealth holdings, firm revenues or any other non-negative quantity distributed across units.
  2. Set the basis label to what the figures actually are. It does not change the arithmetic, but it is the single most important piece of context to carry with the number.
  3. Read the coefficient, which runs from zero at perfect equality to one at complete concentration in a single unit.
  4. Check the Lorenz bars. A distribution with a long thin top tail and one that is uniformly spread can share a Gini, and the curve shows the difference.
  5. Note the number of units. A Gini from five group averages and a Gini from fifty thousand household records answer different questions.

The Formula and How It Is Calculated

For n values sorted ascending as x₁ through xₙ, the Gini coefficient is G = (2 ∑ i·xi) ÷ (n ∑ xi) − (n + 1) ÷ n, where i is the rank of each value starting at one. This is algebraically identical to twice the area between the Lorenz curve and the line of perfect equality, and it is the form used because it needs one pass through sorted data rather than an explicit integration.

Work a small case by hand first. Take the values 1, 2, 3, 4 and 5. Here n is 5 and the total is 15. The rank-weighted sum is (1×1) + (2×2) + (3×3) + (4×4) + (5×5) = 1 + 4 + 9 + 16 + 25 = 55. So G = (2 × 55) ÷ (5 × 15) − 6 ÷ 5 = 110 ÷ 75 − 1.2 = 1.466667 − 1.2 = 0.266667.

Now the default. The values 12,000, 25,000, 40,000, 62,000 and 130,000 total 269,000. The rank-weighted sum is 12,000 + 50,000 + 120,000 + 248,000 + 650,000 = 1,080,000. So G = 2,160,000 ÷ 1,345,000 − 1.2 = 1.605948 − 1.2 = 0.405948, or 40.59 on the index scale. The top unit holds 130,000 ÷ 269,000 = 48.33 percent of the total and the bottom unit holds 4.46 percent. The World Bank's Gini index series documents the household-survey basis it uses for published country figures.

Advertisement

Which Gini You Are Actually Looking At

This is where most misreadings start. There is no single Gini coefficient for a country; there is a family of them, and quoting one without its basis makes it uninterpretable. The four choices that matter most are all invisible in the number itself.

The income concept comes first. Market income — earnings, self-employment and capital income before any state intervention — always gives a higher Gini than disposable income, which is market income plus transfers minus direct taxes. In most developed economies the gap between the two is large, and it is the gap rather than either level that tells you what redistribution is doing. Comparing one country's market-income Gini with another's disposable-income Gini produces a difference that is entirely an artefact of the comparison.

The unit of analysis comes second. A Gini across individuals, across households, and across households equivalised for size all differ, because a household of four on a given income is not as well off as one person on the same income. Equivalence scales adjust for this, and different agencies use different scales. Third, wealth versus income: wealth Ginis are far higher than income Ginis everywhere, typically because wealth can be zero or negative while income rarely is. Fourth, the survey — household surveys systematically miss the very top of the distribution, so administrative tax data usually yields a higher figure for the same population and year. The US Census Bureau's page on income inequality metrics sets out several alternative indices alongside the Gini for exactly this reason.

What the Gini Cannot See

The coefficient compresses an entire distribution into one number, and compression always loses something. Two specific losses are worth knowing about because they change conclusions.

First, the Gini is most sensitive to changes around the middle of the distribution and least sensitive at the extremes. That is a property of how the Lorenz area is constructed. A transfer of income from a very rich household to a slightly less rich one barely moves the coefficient, while the same transfer near the median moves it more. If your question is specifically about top concentration, a top-decile or top-percentile share answers it directly and the Gini does not.

Second, Lorenz curves can cross. Two distributions can have the same Gini while one has a large poor group and a thin top tail and the other has a compressed bottom and a heavy upper-middle. Where curves cross, no single-number index can rank the distributions unambiguously, and the ranking you get depends on which index you chose. This is why serious analysis reports the Gini alongside decile shares and at least one alternative measure. Our standard deviation calculator and coefficient of variation calculator give scale-dependent and scale-free dispersion measures respectively, and both react differently to the tails.

The Same Mathematics Outside Economics

Nothing in the formula is economic. It measures how unequally any non-negative quantity is spread across any set of units, which is why the same coefficient turns up in several unrelated fields.

In ecology it measures how unevenly biomass or abundance is distributed across individuals or species. In machine learning a closely related quantity — Gini impurity — is used to choose splits in decision trees, though that is a different formula despite the shared name and the two are often confused. In business analytics it is applied to revenue concentration across customers, which is a direct analogue of income inequality across households: if a small number of accounts produce most of the revenue, the Gini is high and the associated risk is concentrated.

For market structure specifically, though, the Gini is usually the wrong tool. It is invariant to the number of firms in a sense that matters: a market with two equal firms and a market with two hundred equal firms both have a Gini of zero, even though they are competitively nothing alike. Our Herfindahl index calculator implements the measure that competition authorities actually use, which responds to firm count as well as to inequality of shares. Use the Gini when the question is about spread and the Herfindahl when the question is about concentration.

Need a statistic that carries its assumptions with it?

Arb Digital builds free tools that name the convention behind every number they produce.

Browse All Free Tools Talk To Our Team

Common Mistakes to Avoid

  • Comparing Ginis on different bases — market income against disposable income, or individuals against equivalised households, produces a difference that is an artefact of the definitions rather than a real one.
  • Computing from grouped data and calling it the population Gini — quintile averages discard within-group variation and always give a lower figure than individual records would.
  • Treating a Gini as a ranking of two distributions — where Lorenz curves cross, no single index ranks them, and a different index can reverse the order.
  • Using it for market concentration — two equal firms and two hundred equal firms both score zero, which is exactly the distinction a competition analysis needs.
  • Feeding in negative values — the Lorenz curve is not defined when cumulative totals can fall, and the formula returns a value above one that means nothing.

Related Free Tools From Arb Digital

Compute national output with the GDP calculator, measure market concentration properly with the Herfindahl index calculator, get dispersion in original units with the standard deviation calculator, get it scale-free with the coefficient of variation calculator, or convert shares and changes with the percentage calculator. The full free online tools hub lists every statistics tool we publish.

Frequently Asked Questions

What does a Gini coefficient of zero or one mean?

Zero means every unit holds exactly the same amount, so the Lorenz curve sits on the equality line. One means a single unit holds everything and all others hold nothing. Real distributions fall between the two.

What is the difference between the Gini coefficient and the Gini index?

Only the scale. The coefficient runs from zero to one and the index is the same figure multiplied by one hundred. Both are reported here so a published figure can be matched on either scale.

Why does my figure differ from the published national one?

Almost always because of the basis. Published figures specify an income concept, a unit of analysis, an equivalence scale and a data source, and changing any one of those moves the coefficient substantially.

Can I calculate a Gini from quintile shares?

Yes, and the tool accepts them, but the result is the between-group Gini only. It ignores inequality inside each quintile and is therefore always lower than the figure individual records would give.

Does the currency or unit matter?

No. The Gini is scale-invariant, so multiplying every value by any positive constant leaves it unchanged. That is what makes it usable across countries and across time without conversion.

Why does the calculator reject negative values?

The Lorenz curve requires cumulative totals that never fall, which negative values break, and the standard formula then returns a coefficient above one that cannot be interpreted. Agencies bottom-code or use a different index instead.

Is the Gini a good measure of top-end concentration?

Not particularly. It is most responsive to changes around the middle of the distribution. If the question is about the top, a top-decile or top-percentile share answers it far more directly.

Should I use the Gini for market share analysis?

Usually not. It is blind to how many firms there are, so two equal firms and two hundred equal firms both score zero. The Herfindahl-Hirschman index is the measure competition authorities use.

This page explains a statistical definition for educational purposes and publishes no economic data. Results depend entirely on the figures you enter; for authoritative inequality statistics consult your national statistics office or a qualified economist.

Advertisement
Advertisement

Take it further