Skip to content
Business

Gini Coefficient Calculator

Calculate the Gini coefficient to measure inequality in any distribution using the Lorenz curve approach. Features step-by-step calculation, interactive Lorenz curve visualization, and inequality interpretation.

Distribution Inputs

%
%
%
%
%

Total Quintile Share Sum: 100.0%

Gini Coefficient

0.4560

Gini Index: 45.6 • High Inequality

20/20 Ratio (S80/S20)

17.2x

Top 20% vs Bottom 20% share

Palma Ratio

4.72x

Richest 10-20% vs Poorest 40%

Inequality Area (A)

0.2280

Area between equality & Lorenz curve

Lorenz Curve Visualization

Cumulative population share vs cumulative income/wealth earned.

Perfect EqualityLorenz Curve
20%20%40%40%60%60%80%80%0%100%0%100%Cumulative Population Share (%)Cumulative Income Share (%)

Lorenz Geometry Decomposition

Gini46%
  • Inequality Gap (A)0.228045.6%
  • Equality Area (B)0.272054.4%

How we calculated this

Open to see each step from your inputs to the result.

  1. Determine Cumulative Population and Income Shares

    Xk=kn,Yk=i=1kyii=1nyiX_k = \frac{k}{n}, \quad Y_k = \frac{\sum_{i=1}^k y_i}{\sum_{i=1}^n y_i}

  2. Calculate Area Under the Lorenz Curve (B)

    B=k=1KYk+Yk12(XkXk1)B = \sum_{k=1}^K \frac{Y_k + Y_{k-1}}{2} (X_k - X_{k-1})

  3. Compute Gini Coefficient (G)

    G=AA+B=0.5B0.5=12BG = \frac{A}{A + B} = \frac{0.5 - B}{0.5} = 1 - 2B

Report tool

Understanding the Gini coefficient and economic inequality

The Gini coefficient is the most widely adopted statistical metric for quantifying economic dispersion, wealth concentration, and income inequality across a society. Developed by Italian statistician Corrado Gini in 1912, the metric condenses an entire population distribution into a single scalar between 0 and 1. A score of 0 represents absolute equality, where every individual holds the exact same share of wealth or income. A score of 1 represents total inequality, where a single individual captures 100 percent of total resources while all others receive zero.

Macroeconomic evaluations frequently pair national output with distribution metrics. While our GDP calculator aggregates total domestic economic activity and our GDP per capita calculator divides that production evenly across the resident population, averages alone conceal internal disparities. Two nations with identical average incomes can exhibit starkly different qualities of life if one distributes earnings broadly while the other concentrates prosperity in the top decile. At a household level, understanding how much earnings remain after mandatory obligations requires inspecting net pay with our disposable income calculator and evaluating surplus cash flow with our discretionary income calculator.

The Lorenz curve and geometric foundation

The Gini coefficient is derived directly from the Lorenz curve, a graphical representation of cumulative wealth distribution originally introduced by Max Lorenz in 1905. On a Cartesian plane spanning from 0 to 100 percent:

  • The horizontal axis plots the cumulative percentage of the population, ordered from lowest earner to highest earner.
  • The vertical axis plots the cumulative percentage of total income or wealth earned by that segment.
  • The 45-degree diagonal line represents the line of perfect equality, where the bottom 20 percent earns 20 percent of income, the bottom 50 percent earns 50 percent, and so forth.
  • The empirical Lorenz curve sags below the 45-degree line whenever any income inequality exists.

Let A denote the area between the 45-degree line of perfect equality and the empirical Lorenz curve. Let B denote the area underneath the empirical Lorenz curve. Because the area under the diagonal triangle is exactly 0.5, the total area is A + B = 0.5. The Gini coefficient is defined as the proportion of area A relative to the total triangular area:

G=AA+B=A0.5=2A=2(0.5B)=12BG = \frac{A}{A + B} = \frac{A}{0.5} = 2A = 2(0.5 - B) = 1 - 2B

When income is distributed with absolute uniformity, the Lorenz curve overlaps the 45-degree line perfectly. In that scenario, area A equals 0 and B equals 0.5, resulting in G = 0. Conversely, if one earner captures all national income, the Lorenz curve remains along the bottom axis until the final individual, causing area B to collapse to 0 and yielding G = 1.

Mathematical formulas for discrete data and quintiles

1. Discrete individual or grouped observations

For an empirical sample of n individuals with non-negative incomes sorted in non-decreasing order (y₁ ≤ y₂ ≤ ... ≤ yₙ), the standard relative mean difference formulation computes the pairwise absolute differences between all individuals:

G=i=1nj=1nyiyj2n2yˉ=i=1n(2in1)yini=1nyiG = \frac{\sum_{i=1}^n \sum_{j=1}^n |y_i - y_j|}{2 n^2 \bar{y}} = \frac{\sum_{i=1}^n (2i - n - 1) y_i}{n \sum_{i=1}^n y_i}

Here, ȳ represents the sample mean and i represents the 1-based rank of each observation. For finite samples, standard survey methodology occasionally applies Bessel-style bias correction by multiplying the sample estimate by n / (n - 1) to estimate the underlying population parameter.

2. Grouped quintile distributions (Trapezoidal numerical integration)

National statistical agencies such as the US Census Bureau, Eurostat, and the World Bank commonly publish income distribution by population quintiles (five equal 20 percent brackets). Let Xₖ represent the cumulative population proportion (0.0, 0.2, 0.4, 0.6, 0.8, 1.0) and Yₖ represent the cumulative income share. Using the trapezoidal rule, area B under the Lorenz curve is approximated as:

B=k=15Yk+Yk12(XkXk1)=0.1×k=15(Yk+Yk1)B = \sum_{k=1}^5 \frac{Y_k + Y_{k-1}}{2} (X_k - X_{k-1}) = 0.1 \times \sum_{k=1}^5 (Y_k + Y_{k-1})

Substituting area B back into the fundamental identity G = 1 - 2B gives the exact trapezoidal estimate:

G=115[1+2(Y1+Y2+Y3+Y4)]G = 1 - \frac{1}{5} \left[ 1 + 2(Y_1 + Y_2 + Y_3 + Y_4) \right]

International benchmarks and interpretation scale

The Gini index is simply the Gini coefficient expressed as a percentage (Gini Index = G x 100). The World Bank and the Organisation for Economic Co-operation and Development (OECD) classify economies into distinct structural inequality tiers:

Gini RangeClassificationTypical International Profiles
< 0.25Very Low InequalitySlovakia, Slovenia, Belarus, Czech Republic
0.25 – 0.30Low InequalityNordic economies (Norway, Sweden, Denmark, Finland), Austria, Belgium
0.30 – 0.40Moderate InequalityOECD average (~0.32), Canada, France, Germany, Japan, United Kingdom
0.40 – 0.50High InequalityUnited States (~0.41 post-tax, ~0.48 pre-tax), China, Russia, Mexico
≥ 0.50Severe InequalitySouth Africa (~0.63), Brazil, Colombia, Zambia

Complementary inequality metrics: Palma and 20/20 ratios

A notable critique of the Gini coefficient is its sensitivity to changes in the middle of the distribution rather than shifts at the extreme tails. Economists frequently analyze the Gini coefficient alongside supplementary measures:

  • Palma Ratio: Introduced by Chilean economist Gabriel Palma, this metric divides the income share of the richest 10 percent by that of the poorest 40 percent. Empirical studies show that the middle 50 percent of the population consistently captures roughly half of gross national income across diverse nations, making the ratio between the top decile and bottom four deciles a sharp indicator of structural redistribution.
  • 20/20 Quintile Ratio (S80/S20): Compares the average income or aggregate wealth of the top 20 percent directly against that of the bottom 20 percent. In highly equal societies, this ratio ranges from 3x to 5x, whereas in unequal societies it often exceeds 15x.

For households allocating their own cash flow, balancing essential obligations and discretionary choices can follow established frameworks like the 50/30/20 rule budget calculator, which reserves 50 percent of after-tax income for essentials, 30 percent for lifestyle spending, and 20 percent for savings and investments.

Step-by-step worked example

Consider an economy whose annual household income is divided across quintiles as follows:

  • Quintile 1 (Bottom 20%): 4.0% share of total income
  • Quintile 2 (Second 20%): 9.0% share of total income
  • Quintile 3 (Middle 20%): 15.0% share of total income
  • Quintile 4 (Fourth 20%): 24.0% share of total income
  • Quintile 5 (Top 20%): 48.0% share of total income

First, establish cumulative population shares X and cumulative income shares Y:

  • X₀ = 0.0, Y₀ = 0.00
  • X₁ = 0.2, Y₁ = 0.04
  • X₂ = 0.4, Y₂ = 0.04 + 0.09 = 0.13
  • X₃ = 0.6, Y₃ = 0.13 + 0.15 = 0.28
  • X₄ = 0.8, Y₄ = 0.28 + 0.24 = 0.52
  • X₅ = 1.0, Y₅ = 0.52 + 0.48 = 1.00

Next, compute the trapezoidal area underneath each segment:

B=0.1×[(0+0.04)+(0.04+0.13)+(0.13+0.28)+(0.28+0.52)+(0.52+1.00)]B = 0.1 \times [(0 + 0.04) + (0.04 + 0.13) + (0.13 + 0.28) + (0.28 + 0.52) + (0.52 + 1.00)]

Summing the pairwise trapezoids yields:

B=0.1×[0.04+0.17+0.41+0.80+1.52]=0.1×2.94=0.2940B = 0.1 \times [0.04 + 0.17 + 0.41 + 0.80 + 1.52] = 0.1 \times 2.94 = 0.2940

Finally, apply the Gini formula:

G=12(0.2940)=10.5880=0.4120G = 1 - 2(0.2940) = 1 - 0.5880 = 0.4120

This produces a Gini coefficient of 0.4120, corresponding to a Gini index of 41.2. On the international benchmark scale, this falls into the high inequality bracket, mirroring modern market economies prior to tax redistribution.

Frequently asked questions

What is the difference between the Gini coefficient and the Gini index?
The Gini coefficient is expressed as a decimal between 0 and 1, whereas the Gini index is the exact same number multiplied by 100 to represent a percentage score between 0 and 100. A coefficient of 0.35 equals a Gini index of 35.
Can the Gini coefficient ever be negative or exceed 1?
In standard income measurements, Gini values remain strictly between 0 and 1. However, when applied to net worth or wealth distributions where individuals hold negative equity or severe debt, the empirical Lorenz curve can dip below zero, resulting in theoretical scores slightly above 1 or mathematically negative readings in extreme edge cases.
Why is wealth inequality almost always higher than income inequality?
Income represents a flow of funds earned over a specific timeframe (such as a calendar year), whereas wealth represents cumulative stock accumulated across generations through savings, compounding assets, and capital appreciation. Most advanced nations report income Gini coefficients between 0.28 and 0.45, but wealth Gini coefficients between 0.65 and 0.85.
What is the difference between pre-tax and post-tax Gini coefficients?
Pre-tax (market income) Gini measures inequality produced purely by private wages, investments, and business profits before government intervention. Post-tax and transfer (disposable income) Gini accounts for progressive income taxes, social security benefits, and welfare transfers. In Western Europe, social transfers reduce market Gini scores by 10 to 15 points.
Does a lower Gini coefficient always mean a healthier economy?
Not necessarily. While severe inequality undermines social cohesion, educational access, and long-term economic mobility, an artificially depressed Gini score can reflect widespread, uniform poverty where everyone earns similarly low subsistence wages. Economists evaluate Gini alongside GDP per capita, median living standards, and poverty rates.
Are my entered calculations and distribution datasets saved on a server?
No. All calculations and Lorenz curve visualizations execute entirely on your device in your browser. Inputs are reflected in URL query parameters so you can easily bookmark or share your scenarios without any remote storage.

Resources and references

The formulas and methods in this calculator were checked against these independent sources.