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.
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.
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.
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.