Gini Coefficient Calculator (Income Inequality)

JJ Ben-Joseph headshot JJ Ben-Joseph

What the Gini coefficient measures

The Gini coefficient is a widely used summary statistic for inequality. It compresses an entire income (or wealth) distribution into a single number between 0 and 1:

It’s used in economics, sociology, public policy, and data journalism because it allows comparisons across places and time. That said, it is still a summary: different distributions can share the same Gini value, and the number is sensitive to how data are defined and cleaned (see limitations).

How this calculator works (step by step)

This calculator expects a list of incomes (for individuals or households) separated by commas and/or new lines. When you click Calculate, it:

  1. Parses your entries into numeric values.
  2. Optionally filters invalid entries and (by default) rejects negative incomes (configurable guidance below).
  3. Sorts incomes from smallest to largest.
  4. Computes the Gini coefficient using a standard discrete formula for an unweighted sample.

The Lorenz curve connection (intuition)

The Gini coefficient is closely tied to the Lorenz curve, which plots the cumulative share of income earned by the bottom share of the population after sorting from poorest to richest. If everyone earned the same, the Lorenz curve would follow the 45° line of equality. Real distributions typically bow below that line. The Gini coefficient is proportional to the area between the line of equality and the Lorenz curve—more bowing implies higher inequality.

Formula used (unweighted sample)

Let the incomes be sorted so that x1x2 ≤ … ≤ xn, with n total observations and total income S = ∑i=1n xi. A common discrete form of the Gini coefficient is:

G = 2 n·S i=1 i·xi n n+1 n

This is mathematically equivalent to other standard Gini formulas (including those based on pairwise absolute differences), but it’s efficient to compute once the values are sorted.

Interpreting your result

A single Gini value is easiest to interpret comparatively: compare regions, years, or groups using the same definition of income and sampling approach. Very rough interpretive bands sometimes used for income distributions are:

These ranges are context-dependent. A country’s “market income” Gini (before taxes/transfers) is typically higher than its “disposable income” Gini (after taxes/transfers). Wealth inequality also tends to produce higher Gini values than income inequality.

Worked example

Suppose five households have annual incomes:

10, 20, 30, 40, 100

These values are already sorted. Here, one household (100) is much richer than the others, so the Lorenz curve bows noticeably below the equality line. The calculator will return a Gini coefficient around the mid-0.3s (exact value depends on rounding). If you changed the last income from 100 to 40:

10, 20, 30, 40, 40

the distribution becomes more even, and the Gini coefficient decreases.

Comparison table (how changes affect Gini)

The table below illustrates how different income patterns typically move the Gini coefficient. (Values shown are qualitative—use the calculator for exact numbers.)

Income list (example) Distribution shape Expected Gini Why
50, 50, 50, 50 Perfectly equal 0.00 Everyone earns the same amount
10, 20, 30, 40 Gradual increase Low–moderate No extreme outliers
10, 20, 30, 40, 100 One high outlier Moderate–high Top income pulls share upward
0, 0, 0, 100 Extreme concentration Very high Most people have zero; one has all income

Assumptions and limitations (important)

Practical tips for better results

Gini coefficient inputs
Paste a list like: 10, 20, 30, 40 or one value per line. Non-negative numbers only. Zeros are allowed.
Enter incomes to estimate the Gini coefficient.

Embed this calculator

Copy and paste the HTML below to add the Gini Coefficient Calculator (Income Inequality from Data) to your website.