Gini Coefficient Calculator

Enter a comma-separated list of values to compute the Gini coefficient.

Result

0.4000
60.0000
5 values

How it is calculated

G = Σi Σj |xi − xj| ÷ (2 × n² × mean), summed over every ordered pair of values, where n is the number of values and mean is their average. Enter the values separated by commas or spaces. Items that are not numbers are silently skipped, which is why you should check the "n values" line. At least 2 values are needed, none may be negative, and the mean must be above zero. Results are shown to four decimals. This is the plain population formula, so with n values the largest possible result is (n − 1) ÷ n, not exactly 1: four values with one holder give 0.7500. The coefficient has no unit, and income, wealth or any other positive quantity can be used.

Worked example

Five household incomes: 20, 30, 40, 50, 160. Mean = 300 ÷ 5 = 60. Absolute differences between the 10 distinct pairs add up to 10+20+30+140+10+20+130+10+120+110 = 600, and counting every ordered pair doubles it to 1,200. Denominator = 2 × 5² × 60 = 3,000. G = 1,200 ÷ 3,000 = 0.4000, with mean 60.0000 and 5 values.

Try this example →

Common mistakes

  • Typing a thousands separator such as 1,200 in the list. The comma splits it into 1 and 200, which changes both the count and the result.
  • Not noticing that a typo word or symbol is skipped; always check that "n values" matches the number you meant to enter.
  • Expecting small samples to reach 1.0000. Because the formula divides by n², one person holding everything among 4 gives 0.7500, and the ceiling is lower the fewer values you have.
  • Entering negative values such as debts or losses; the tool rejects them, so net-worth data with negatives cannot be used directly.
  • Comparing a Gini from a handful of values with national figures built from the whole population or from survey weights.

About this calculator

The Gini coefficient is the standard summary statistic for inequality in a distribution of income, wealth, or any other quantity, ranging from 0 (perfect equality — everyone holds the same amount) toward 1 (perfect inequality — one unit holds everything). For a list of n values this calculator's result tops out at (n − 1) ÷ n, so a small sample can never reach 1. It is derived from the Lorenz curve, which plots the cumulative share of total value held by the poorest x% of the population; the Gini coefficient is twice the area between that curve and the line of perfect equality.

In practice it is computed directly from a list of values using the mean absolute difference between every pair of observations, normalized by twice the mean — the method this calculator uses on the values you provide. Separate them with commas or spaces, enter at least two non-negative numbers, and leave out thousands separators: “1,200” is read as the two values 1 and 200.

Economists and organizations like the World Bank and national statistics agencies use the Gini coefficient to compare income or wealth inequality across countries and over time, typically reported on a 0-to-1 scale or as a percentage.

Was this helpful?

You can pick up to 3 reactions.

Comments

  • Be the first to comment.

Popular calculators

All Calculators