Gini Coefficient Calculator

Gini Coefficient Calculator

Growing AI Skill PRO

Enter Calculation

Enter incomes, wealth, or any non-negative quantities separated by commas.

Formula

G=∑i=1n∑j=1n|xi−xj|2n2x‾where{xi=Values (comma-separated)n=number of valuesx‾=1n∑i=1nxi\begin{gathered} G = \frac{\displaystyle\sum_{i=1}^{n}\sum_{j=1}^{n}\left|x_i - x_j\right|}{2\,n^{2}\,\bar{x}} \\[1.5em] \text{where}\quad \left\{ \begin{aligned} x_i &= \text{Values (comma-separated)} \\ n &= \text{number of values} \\ \bar{x} &= \frac{1}{n}\sum_{i=1}^{n} x_i \end{aligned} \right. \end{gathered}
Usage stats

Advertisement

Results

Gini Coefficient
0.25
0 = perfect equality, 1 = maximum inequality
Gini index (%) 25%
Number of values 4
Mean value 25

Report an error on this page

What Is the Gini Coefficient?

The Gini coefficient is the most widely used statistical measure of inequality. It condenses an entire distribution — of income, wealth, firm sizes, or any non-negative quantity — into a single number between 0 and 1. A value of 0 represents perfect equality (everyone has exactly the same amount), while a value approaching 1 represents maximum inequality (one unit holds everything). This calculator is universal: it works for any list of numbers and is not tied to any country or currency.

Lorenz curve diagram with a diagonal line of equality and a bowed curve, showing the Gini area between them
The Gini coefficient equals area A divided by area A+B between the line of equality and the Lorenz curve.

How to Use This Calculator

Enter your values separated by commas — for example individual incomes, salaries, or sales figures. The calculator computes the mean of all values and the average absolute difference between every pair, then returns the Gini coefficient along with the equivalent Gini index as a percentage, the count of values, and the mean.

The Formula Explained

This tool uses the relative mean absolute difference formula:

$$G = \frac{\displaystyle\sum_{i=1}^{n}\sum_{j=1}^{n}\left|x_i - x_j\right|}{2\,n^{2}\,\mu}$$

Here the double sum adds up the absolute difference between every ordered pair of values, \(n\) is how many values there are, and \(\mu\) is their mean. Dividing by \(2n^{2}\mu\) normalizes the result to the 0–1 range. This pairwise method gives the same answer as the Lorenz-curve area method but is easier to compute directly from raw data.

Advertisement
Two flat bars comparing perfect equality with one tall bar dominating others
A Gini of 0 means everyone shares equally; a Gini near 1 means one share dominates.

Worked Example

Take four incomes: 10, 20, 30, 40. The mean \(\mu = 25\). The sum of all pairwise absolute differences is 200. Plugging in:

$$G = \frac{200}{2 \times 4^{2} \times 25} = \frac{200}{800} = 0.25$$

or a Gini index of 25%. This indicates a moderately equal distribution.

Typical Gini Coefficients by Country

The table shows approximate Gini coefficients of disposable (after-tax and transfer) income, rounded from World Bank Poverty and Inequality Platform and OECD Income Distribution Database figures. Years are the most recent surveys around 2019–2022, except South Africa, where the widely cited survey year is older. Treat all values as rounded orientation points, not exact figures.

Country Approx. Gini (0–1) Approx. Gini index (0–100) Rough data period
Slovenia 0.24 24 early 2020s
Norway 0.27 27 c. 2019–2020
Canada 0.31 31 c. 2020–2021
Germany 0.32 32 c. 2020
France 0.32 32 c. 2020
United Kingdom 0.33 33 c. 2021
China 0.37 37 c. 2020
United States 0.41 41 c. 2022
Brazil 0.52 52 c. 2022
South Africa 0.63 63 c. 2014

Caveats: Figures differ by source, year and income definition. Market (pre-tax, pre-transfer) income Ginis are usually considerably higher than disposable-income Ginis, especially in countries with large redistribution. Some surveys measure consumption rather than income, and equivalence scales and household vs. per-person units also change the result. Check the original dataset before citing a specific number.

Advertisement

Interpreting Your Gini Result

The Gini coefficient runs from 0 (everyone has the same value) to 1 (one person has everything). The Gini index is simply the coefficient multiplied by 100, so 0.35 corresponds to an index of 35.

Common descriptive bands

These are informal conventions used in World Bank, OECD and UN reporting, not official cutoffs:

Gini coefficient Typical description
Below 0.30 Relatively equal distribution
0.30 – 0.40 Moderate inequality
0.40 – 0.50 High inequality
Above 0.50 Very high inequality

Small example

For the values 10, 20, 30, 40: the mean is \(\bar{x} = 25\), the sum of absolute differences over all ordered pairs is 200, and \(n = 4\). Then

$$G = \frac{200}{2 \cdot 4^{2} \cdot 25} = \frac{200}{800} = 0.25$$

With the small-sample correction \(\frac{n}{n-1}\) this becomes \(0.25 \times \frac{4}{3} \approx 0.333\). The correction matters for small samples and fades as \(n\) grows.

Limitations

  • Different distributions, same Gini: Lorenz curves can cross and still produce the same coefficient, so one number hides where the inequality sits.
  • Sensitivity: The Gini is most sensitive to changes around the middle of the distribution and less to changes at the very top or bottom tails.
  • Income vs. wealth: Wealth Ginis are typically much higher than income Ginis, because wealth is more concentrated and many people hold zero or negative net worth. Compare like with like.
  • Units: Results depend on whether values are per household or per individual, and on whether equivalence scales, taxes and transfers are applied.
  • Sample size: The plain formula tends to understate inequality in small samples; multiplying by \(\frac{n}{n-1}\) is a common adjustment. Survey design and top-coding of high incomes also affect results.
  • Negative values: Negative entries (such as debts) can push the coefficient above 1 and need careful interpretation.

This is general educational information about a statistical measure, not financial or policy advice.

FAQ

What is a "good" Gini coefficient? For national income, values below 0.3 are considered relatively equal, while values above 0.5 indicate high inequality.

Can I use percentages or shares instead of raw amounts? Yes — the Gini coefficient is scale-invariant, so multiplying every value by a constant does not change the result.

Do the values need to be sorted? No. The pairwise difference formula gives the same answer regardless of order.

Last updated:

Most popular in Financial

View all Financial calculators