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.
Inputs
Gini Coefficient
—
Explain my result
Get a plain-English breakdown of your result with practical next steps.
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:
- Sort the quintiles ascending — confirm Q1 < Q2 < Q3 < Q4 < Q5 and label them x(1) through x(5).
- Apply rank weights — multiply each quintile mean by its corresponding weight: −4, −2, 0, +2, or +4.
- Sum the weighted products — add all five results to obtain the numerator.
- Compute the denominator — multiply n (= 5) by the simple sum of all five quintile means.
- 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