terican

Last verified · v1.0

Calculator · math

Gini Coefficient Calculator

Compute the Gini coefficient from five quintile mean incomes to measure income inequality on a 0-to-1 scale.

FreeInstantNo signupOpen source

Inputs

Gini Coefficient

Explain my result

0/3 free

Get a plain-English breakdown of your result with practical next steps.

Gini Coefficient

The formula

How the
result is
computed.

What Is the Gini Coefficient?

The Gini coefficient (also called the Gini index or Gini ratio) is the most widely used single-number measure of income or wealth inequality in economics and social science. Italian statistician Corrado Gini introduced the measure in 1912, grounding it in the geometry of the Lorenz curve. The coefficient compresses an entire income distribution into one number between 0 and 1 — where 0 represents perfect equality (everyone earns identical income) and 1 represents perfect inequality (one person earns all income). A coefficient of 0.28 signals a relatively egalitarian society, while a coefficient above 0.50 indicates severe disparity.

The Core Formula

For a population of n income recipients whose incomes are sorted in ascending order as x(1) ≤ x(2) ≤ … ≤ x(n), the Gini coefficient is defined as:

G = Σ (2i − n − 1) · x(i) / [n · Σ x(i)]

This ranked-sum formulation, rigorously presented in Measuring Resource Inequality: The Gini Coefficient (University of South Florida Numeracy journal), eliminates the need to construct a Lorenz curve explicitly. The University of Texas Inequality Project confirms this approach yields results identical to the classical area-based Lorenz curve method while remaining computationally straightforward for grouped data.

Variable Definitions

  • n — Total number of income groups. This calculator uses n = 5 quintiles, each covering 20% of the population.
  • i — The rank of each group after sorting from lowest to highest income (1 = poorest quintile, 5 = richest quintile).
  • x(i) — The mean income of the i-th ranked group.
  • Q1 (income_q1) — Average income of the bottom 20%; the lowest-earning quintile.
  • Q2 (income_q2) — Average income of the 20th–40th percentile band.
  • Q3 (income_q3) — Average income of the middle 20% (40th–60th percentile).
  • Q4 (income_q4) — Average income of the 60th–80th percentile band.
  • Q5 (income_q5) — Average income of the top 20%; the highest-earning quintile.

Step-by-Step Calculation with Quintile Data

With five quintile mean incomes and n = 5, the rank weights (2i − n − 1) evaluate to −4, −2, 0, +2, +4 for ranks 1 through 5 respectively. The calculation proceeds as follows:

  1. Sort the quintiles ascending — confirm Q1 < Q2 < Q3 < Q4 < Q5 and label them x(1) through x(5).
  2. Apply rank weights — multiply each quintile mean by its corresponding weight: −4, −2, 0, +2, or +4.
  3. Sum the weighted products — add all five results to obtain the numerator.
  4. Compute the denominator — multiply n (= 5) by the simple sum of all five quintile means.
  5. Divide numerator by denominator — the quotient is G.

Worked Example

Consider a hypothetical country with the following annual quintile mean incomes:

  • Q1: $15,000 | Q2: $30,000 | Q3: $50,000 | Q4: $75,000 | Q5: $180,000

Weighted products: (−4 × $15,000) + (−2 × $30,000) + (0 × $50,000) + (2 × $75,000) + (4 × $180,000) = −$60,000 − $60,000 + $0 + $150,000 + $720,000 = $750,000.

Denominator: 5 × ($15,000 + $30,000 + $50,000 + $75,000 + $180,000) = 5 × $350,000 = $1,750,000.

G = $750,000 / $1,750,000 ≈ 0.429 — consistent with moderate-to-high inequality, comparable to mid-range Latin American economies.

Interpreting the Result

Real-economy benchmarks place the result in context:

  • 0.25–0.30: Low inequality — Norway (≈ 0.26), Denmark (≈ 0.28), Finland (≈ 0.27).
  • 0.30–0.38: Moderate inequality — most Western European nations, Canada (≈ 0.33).
  • 0.39–0.41: Elevated inequality — the United States has registered in this range consistently since the 1990s.
  • 0.50+: High inequality — Brazil (≈ 0.53), South Africa (≈ 0.63).

Limitations and Caveats

The Gini coefficient aggregates distributional information into a single scalar, which conceals structural differences between distributions. Two countries with identical Gini scores can differ markedly in shape — one may concentrate poverty at the very bottom while another concentrates wealth only at the very top. Additionally, the quintile approach averages within each 20% band, smoothing intra-quintile variation. For greater precision, decile or percentile data — or full survey microdata — yield superior resolution, as documented in research on empirical Lorenz curve estimation published through the National Institutes of Health. Analysts typically complement the Gini with the Palma ratio or the S80/S20 income quintile share ratio for a more complete distributional picture.

Reference

Frequently asked questions

What does a Gini coefficient of 0.40 mean?
A Gini coefficient of 0.40 signals moderate-to-high income inequality. On the 0-to-1 scale, 0 means every person earns identically and 1 means one person earns everything. A score of 0.40 matches the United States historical average (roughly 0.39–0.41) and indicates that income is significantly concentrated toward higher earners, with the top quintile capturing a disproportionately large share of national income relative to the bottom quintile.
How is the Gini coefficient related to the Lorenz curve?
The Lorenz curve plots the cumulative share of total income (y-axis) held by the bottom x% of earners (x-axis). The Gini coefficient equals twice the area between the 45-degree line of perfect equality and the Lorenz curve. The ranked-sum formula (G = Σ(2i−n−1)x(i) / n·Σx(i)) produces mathematically identical results without requiring explicit curve construction, making it efficient for grouped quintile or decile datasets published by statistical agencies.
What is considered a good Gini coefficient for a country?
No single value is universally optimal, but most economists consider coefficients below 0.30 to indicate low inequality and scores above 0.50 to signal severe disparity. Scandinavian nations such as Norway (≈ 0.26) and Denmark (≈ 0.28) consistently post the lowest scores among developed countries. The global average hovers near 0.40. Policy goals typically aim to reduce the coefficient over time through progressive taxation and social transfers, while sustaining economic growth.
Can the Gini coefficient be greater than 1 or less than 0?
No — for any non-negative income distribution where at least one person has positive income, the Gini coefficient is mathematically bounded within the interval [0, 1]. A value of exactly 0 represents perfect equality and a value of exactly 1 represents absolute concentration in a single individual. Distributions containing negative incomes (such as net business losses) can theoretically push the coefficient above 1 in extended formulations, but standard quintile income data always produces a result in the 0-to-1 range.
Why does this calculator use quintile data instead of individual incomes?
National statistical agencies — including the U.S. Census Bureau, Eurostat, and the World Bank — routinely publish income distributions in quintile form (five equal 20% population groups) rather than releasing individual microdata, due to respondent privacy constraints. The quintile-based formula provides a reliable approximation to the true Gini coefficient and remains fully reproducible from publicly available government reports. Researchers requiring higher precision use decile breakdowns or full household survey microdata when those datasets are accessible.
What are the main limitations of the Gini coefficient?
The Gini coefficient collapses an entire income distribution into one number, meaning two countries with identical coefficients can exhibit very different distributional structures — one might concentrate deprivation at the bottom while another clusters wealth at the top. The measure also ignores household size, regional cost-of-living differences, non-monetary benefits such as subsidized healthcare or education, and the distinction between income and accumulated wealth. Analysts pair the Gini with complementary indicators such as the Palma ratio (top-10% income share divided by bottom-40% share) and the S80/S20 quintile share ratio for a more comprehensive assessment.