Gini Coefficient Calculator

Measure statistical dispersion and inequality in income or wealth distributions

About the Gini Coefficient Calculator

The Gini Coefficient Calculator is a specialized tool used by economists, sociologists, and policymakers to quantify the level of inequality within a specific population. Most commonly applied to income and wealth distribution, the Gini index provides a single numerical value that summarizes the gap between the rich and the poor. By analyzing how cumulative percentages of total income compare to cumulative percentages of the population, users can determine if a resource distribution is moving toward equity or concentration.

Statisticians use this tool to compare economic health across different eras or geographic regions regardless of population size. While it is the gold standard for measuring inequality, it is also utilized in ecology to measure biodiversity and in finance to assess the risk concentration in credit portfolios. This calculator processes raw data sets—such as household incomes or asset values—to produce a coefficient that ranges from 0 (perfect equality) to 1 (perfect inequality), offering a clear metric for social and economic analysis.

Formula

G = (Σ Σ |xi - xj|) / (2 * n^2 * μ)

The Gini coefficient (G) is calculated by taking the sum of the absolute differences between all pairs of individuals in the population (xi and xj). This sum is then divided by twice the square of the population size (n) multiplied by the mean value of the distribution (μ). This normalization ensures the result stays between 0 and 1. Alternatively, if data is ordered from smallest to largest, the formula simplifies to G = (2 * Σ(i * xi) / (n * Σxi)) - (n + 1) / n, where i is the rank of the individual.

Worked examples

Example 1: A small neighborhood has five residents with annual incomes of $20,000, $30,000, $40,000, $60,000, and $100,000.

1. List incomes: 20,000, 30,000, 40,000, 60,000, 100,000 (n=5).
2. Calculate Mean (μ): 250,000 / 5 = 50,000.
3. Calculate absolute differences between all pairs: |20-30|, |20-40|, |20-60|, etc. Total sum of differences = 156,000.
4. Apply formula: 156,000 / (2 * 5^2 * 50,000) = 156,000 / 500,000.
5. Final result: 0.312.

Result: 0.311 (moderate inequality). This suggests a relatively balanced distribution of income among the five residents.

Common use cases

Pitfalls and limitations

Frequently asked questions

what does a gini coefficient of 0 and 1 mean?

A Gini coefficient of 0 represents perfect equality, where every individual has the exact same income or wealth. Conversely, a coefficient of 1 (or 100%) represents maximal inequality, where one person holds all the resources and everyone else holds none.

can two countries with different gdp have the same gini?

While the Gini coefficient measures the distribution of income within a group, it does not account for the total wealth or GDP of a nation. Two countries can have identical Gini coefficients despite one being significantly wealthier than the other in absolute terms.

why is wealth gini higher than income gini?

Wealth Gini coefficients are almost always higher than income Gini coefficients. This is because wealth (assets and savings) tends to accumulate over generations and is more concentrated than annual earnings, which are distributed across the workforce.

what is a good gini coefficient for a country?

A coefficient between 0.20 and 0.35 is generally considered low inequality, typical of Nordic countries. Values between 0.45 and 0.60 indicate high inequality, often seen in developing nations or countries with significant structural social barriers.

how is gini coefficient calculated from lorenz curve?

The Gini coefficient is mathematically defined as half of the relative mean absolute difference. This equates to the area between the Lorenz curve (the cumulative distribution of income) and the line of perfect equality, divided by the total area under that line.

Related calculators

5 Number Summary Calculator
Calculate the five-number summary (min, Q1, median, Q3, max) and visualize with a box plot
Absolute Uncertainty Calculator
Calculate absolute and relative uncertainty for measurements and experimental data
Average Rating Calculator
Calculate the weighted average star rating from individual vote counts for reviews and feedback
Accuracy Calculator
Calculate accuracy, precision, and error rates for statistical analysis
Adjusted R-Squared Calculator
Calculate adjusted R² to account for the number of predictors in regression models
AIC/BIC Calculator
Compare statistical models using Akaike and Bayesian Information Criteria for model selection
Accuracy Calculator
Calculate accuracy, precision, and error rates for statistical analysis
ANOVA Calculator
Perform one-way Analysis of Variance to test if group means differ significantly