# What is the Gini coefficient?

Computes the Gini coefficient (and Gini index) of a list of incomes or of income shares from the Lorenz curve, from 0 for perfect equality to 1 for perfect inequality.

- Page: https://www.acalculator.org/statistics/gini-coefficient-calculator
- JSON spec: https://www.acalculator.org/statistics/gini-coefficient-calculator.json
- Version: 8e472f5bdb1c

## Default answer

Example with the default inputs (Incomes or shares [20,000, 35,000, 50,000, 75,000, 120,000]): The Gini coefficient is 0.32 (Gini index 32).

## Inputs

| Key | Label | Description |
| --- | --- | --- |
| x | Incomes or shares | One income per person or household, or the income shares of equal-size groups (such as quintiles), separated by commas or spaces. |

## Outputs

| Key | Label | Description |
| --- | --- | --- |
| gini | Gini coefficient | The Lorenz-curve area ratio, from 0 (everyone has the same) to (n − 1) ÷ n (one has everything). |
| index | Gini index (0 to 100) | The Gini coefficient times 100. |
| corrected | Sample Gini, n ÷ (n − 1) correction | The Gini coefficient times n ÷ (n − 1), which reaches 1 when one value holds everything. |
| mean | Mean | The average of the values. |
| count | Count | How many values were typed. |

## Method

Sort the n values from smallest, x₁ ≤ … ≤ xₙ. G = 2 Σ i·xᵢ ÷ (n Σ xᵢ) − (n + 1) ÷ n, which equals Σᵢ Σⱼ |xᵢ − xⱼ| ÷ (2 n² x̄) and the Lorenz-curve area ratio; corrected G = G × n ÷ (n − 1).

## Assumptions

- Each value is one person or household, or one equal-size group (quintile shares count as five equal groups).
- The Lorenz curve joins the points by straight lines, so grouped shares give the Gini between the groups only.
- Values must be 0 or more and not all 0.

## Worked examples

1. x = 1 or 2 gives gini = 0.266667, corrected = 0.333333, mean = 3, count = 5. Source: US Census Bureau, Gini Index (Lorenz-curve definition, 0 to 1); https://www.census.gov/topics/income-poverty/income-inequality/about/metrics/gini-index.html.
2. x = 0 or 0 gives gini = 0.75, corrected = 1, index = 75. Source: US Census Bureau, Gini Index (1 is perfect inequality, one recipient has all the income); https://www.census.gov/topics/income-poverty/income-inequality/about/metrics/gini-index.html.
3. x = 20 or 20 gives gini = 0, corrected = 0. Source: US Census Bureau, Gini Index (0 is perfect equality, everyone has an equal share); https://www.census.gov/topics/income-poverty/income-inequality/about/metrics/gini-index.html.
4. x = 20,000 or 35,000 gives gini = 0.32, mean = 60,000. Source: US Census Bureau, Gini Index (Lorenz-curve definition); https://www.census.gov/topics/income-poverty/income-inequality/about/metrics/gini-index.html.

## FAQ

### How do I calculate the Gini coefficient?

Sort the n incomes from smallest to largest, x₁ to xₙ. Then G = 2 × (1·x₁ + 2·x₂ + … + n·xₙ) ÷ (n × total) − (n + 1) ÷ n. For 1, 2, 3, 4, 5: 2 × 55 ÷ (5 × 15) − 6 ÷ 5 = 1.4667 − 1.2 = 0.2667.

### What does a Gini coefficient of 0 or 1 mean?

The US Census Bureau describes 0 as perfect equality, where everyone gets an equal share, and 1 as perfect inequality, where one recipient gets all the income. With a finite list of n values, one value holding everything gives (n − 1) ÷ n, which the corrected value scales to 1.

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

They are the same measure on different scales. The coefficient runs from 0 to 1; the index is the coefficient times 100, as Eurostat and the CIA World Factbook report it.

### Can I use quintile shares?

Yes. Type the five shares (they need not add up to 100). Each counts as one equal-size group, and the page joins the Lorenz-curve points with straight lines. That misses inequality inside each group, so it gives a lower Gini than the full list of incomes would.

### What is the Lorenz curve?

A chart of the cumulative share of people, poorest first, against the cumulative share of income they receive. With equal incomes it is the 45-degree line. The Gini coefficient is the area between the line and the curve, divided by the whole area under the line.

### Why is there a corrected (sample) Gini?

With n values the plain Gini can reach only (n − 1) ÷ n. Multiplying by n ÷ (n − 1) makes the most unequal list give exactly 1, which suits small samples. With many values the two are almost the same.

## Sources

- US Census Bureau. Gini Index (income inequality metrics: definition, Lorenz curve, range 0 to 1), retrieved 2026-10-18. https://www.census.gov/topics/income-poverty/income-inequality/about/metrics/gini-index.html
- Central Intelligence Agency. The World Factbook: Gini Index coefficient, distribution of family income (definition as the ratio of the area between the Lorenz curve and the 45-degree line to the whole triangle), retrieved 2026-10-18. https://www.cia.gov/the-world-factbook/about/archives/2023/field/gini-index-coefficient-distribution-of-family-income
- Eurostat. Glossary: Gini coefficient (0 is perfect equality, 100 is full inequality), retrieved 2026-10-18. https://ec.europa.eu/eurostat/statistics-explained/index.php?title=Glossary:Gini_coefficient
