Gini Coefficient Calculator
Calculate the Gini coefficient to measure income or wealth inequality from a set of values.
What Is the Gini Coefficient?
The Gini coefficient (or Gini index) is a statistical measure of distribution used most commonly to quantify income or wealth inequality within a population. It was developed by the Italian statistician Corrado Gini in 1912. The coefficient ranges from 0 to 1, where 0 represents perfect equality (everyone has the same income) and 1 represents perfect inequality (one person has all the income). This calculator computes the Gini coefficient directly from your dataset using the standard formula based on the Lorenz curve.
How the Gini Coefficient Is Calculated
The calculation follows a well-established method that compares the distribution of values in your dataset against a perfectly equal distribution. The underlying logic is based on the Lorenz curve, which plots the cumulative share of total income against the cumulative share of the population.
Calculation Method
This calculator uses the following approach:
- Sort all values in ascending order.
- Calculate the cumulative sum of the values.
- Compute the Lorenz curve coordinates (cumulative share of the population vs. cumulative share of total income).
- Apply the formula: G = 1 − (2 × area under the Lorenz curve).
More precisely, for a set of n values x₁, x₂, ..., xₙ sorted in ascending order, the Gini coefficient is calculated as:
G = (2 / (n × mean)) × Σ(i × xᵢ) − (n + 1) / n
Where i is the rank of each value (starting from 1) and mean is the arithmetic mean of all values.
How to Use This Calculator
Enter your dataset as a list of numerical values separated by commas, spaces, or new lines. Each value should represent an individual income, wealth amount, or any other quantity you want to measure inequality for. The calculator will process your data and return the Gini coefficient along with supporting statistics.
Input Guidelines
- Use positive numbers only. Negative values or zero can distort the calculation and produce misleading results.
- Include at least two values. A single value cannot produce a meaningful inequality measure.
- Values can be in any unit (dollars, euros, points, etc.) as the coefficient is scale-independent.
- Decimal values are supported.
Example Calculation
Consider a small population of five people with the following annual incomes (in thousands):
10, 20, 30, 40, 100
After sorting: 10, 20, 30, 40, 100
Total income = 200. Mean income = 40.
Using the formula: G = (2 / (5 × 40)) × (1×10 + 2×20 + 3×30 + 4×40 + 5×100) − (5 + 1) / 5
G = (2 / 200) × (10 + 40 + 90 + 160 + 500) − 1.2
G = 0.01 × 800 − 1.2 = 8 − 1.2 = 0.4
The Gini coefficient is 0.4, indicating moderate inequality. The single high earner (100) significantly skews the distribution away from perfect equality.
Understanding Your Results
The Gini coefficient provides a single number that summarizes the inequality in your dataset. Here is how to interpret common ranges:
- 0.00 – 0.25: Low inequality. The distribution is relatively even across all values.
- 0.25 – 0.40: Moderate inequality. This range is typical for many developed countries' income distributions.
- 0.40 – 0.60: High inequality. A significant portion of total value is concentrated among a small fraction of the population.
- 0.60 – 1.00: Very high inequality. Extreme concentration of value, often seen in wealth distributions or small datasets with outliers.
Note that the Gini coefficient does not indicate the source of inequality or whether it is "good" or "bad." It is a descriptive statistic that quantifies dispersion. Context, sample size, and the nature of your data all affect interpretation.
Common Mistakes When Using the Gini Coefficient
- Including negative values: The Gini coefficient assumes non-negative values. Negative incomes or losses will produce mathematically valid but economically meaningless results.
- Comparing coefficients from different sample sizes without caution: Small samples tend to underestimate inequality. A Gini of 0.3 from 10 data points is not directly comparable to one from 10,000 data points.
- Using unweighted data when weights exist: If your data represents groups of different sizes (e.g., average income by region), you should weight each value by its population size. This calculator assumes each value has equal weight.
- Confusing income and wealth inequality: Income Gini coefficients are typically lower than wealth Gini coefficients because wealth is more concentrated than income in most populations.
Limitations and Constraints
- Scale independence: The Gini coefficient is unaffected by the unit of measurement, but it is sensitive to the shape of the distribution.
- No information about absolute levels: Two populations with identical Gini coefficients can have vastly different average incomes or wealth levels.
- Insensitivity to changes in the middle: The Gini coefficient is more sensitive to changes at the extremes of the distribution than in the middle.
- Sample size bias: For very small datasets (fewer than 10 values), the coefficient may not be reliable. A correction factor can be applied for sample-based estimates, but this calculator provides the raw coefficient.
- Does not identify the number of poor or rich: The coefficient summarizes dispersion but does not reveal how many people fall below a poverty line or above a wealth threshold.
Practical Use Cases
- Income distribution analysis: Economists and policymakers use the Gini coefficient to track changes in income inequality over time or across regions.
- Wealth concentration studies: Researchers measure how assets, property, or financial wealth are distributed within a population.
- Business performance metrics: Companies analyze the concentration of revenue across customers or sales across products to identify dependency risks.
- Academic research: Social scientists apply the Gini coefficient to education levels, healthcare access, land ownership, and other resource distributions.
- Portfolio diversification: Investors can use the Gini coefficient to measure how evenly assets are allocated across a portfolio.
Frequently Asked Questions
What is a good Gini coefficient?
There is no universal "good" value. In economics, lower coefficients (below 0.30) are often associated with more equal income distribution, while values above 0.40 are considered high. Context matters: a Gini of 0.25 for income in a developed country may be seen as equitable, while the same value for wealth would be unusually low. The interpretation depends entirely on what you are measuring and the population in question.
Can the Gini coefficient be greater than 1?
No, the Gini coefficient cannot exceed 1 for a standard calculation with non-negative values. A value of 1 would mean one person holds all the income or wealth and everyone else has zero. In practice, values above 0.60 are rare for income distributions but can occur for wealth distributions or very small datasets with extreme outliers.
What is the difference between Gini coefficient and Gini index?
They are the same measure expressed differently. The Gini coefficient is typically reported as a decimal between 0 and 1 (e.g., 0.35). The Gini index is the coefficient multiplied by 100, giving a percentage (e.g., 35%). This calculator returns the coefficient as a decimal value.
How does sample size affect the Gini coefficient?
Small samples tend to produce downward-biased Gini coefficients, meaning they underestimate true inequality. This is because small samples are less likely to capture extreme values at both ends of the distribution. For reliable results, use datasets with at least 20–30 observations. If you are estimating population inequality from a sample, consider applying a correction factor of n/(n−1).
Can I use this calculator for non-income data?
Yes. The Gini coefficient is a general measure of inequality applicable to any non-negative numerical distribution. Common examples include land ownership, educational attainment scores, healthcare spending, energy consumption, and customer revenue concentration. The mathematical calculation is identical regardless of what the values represent.