Gini Coefficient Calculator
Gini coefficient of income, wealth or any values, with a Lorenz curve.
Sort the values from smallest to largest, then G = Σ(2i − n − 1)·xᵢ ÷ (n·Σxᵢ). G = 0 means everyone has the same amount; G near 1 means one person has almost everything. For incomes 10, 20, 30, 40, G = 0.25.
Free, runs in your browser. Nothing you enter is uploaded.
How to use it
- Paste the values (one per person, household or group).
- Read the Gini coefficient and the corrected value for small samples.
- Check the Lorenz curve against the line of equality.
What you enter
- Non-negative values
What you get
- Gini coefficient
- Corrected Gini
- Lorenz curve
- Top and bottom shares
Formula
G = Σᵢ (2i − n − 1)·x₍ᵢ₎ ÷ (n · Σx) with x sorted ascending | G_corrected = G × n ÷ (n − 1)
Worked example
Input: 10, 20, 30, 40
Result: G = 0.25
Moderate inequality: the top half holds 70% of the total.
Questions
How do you calculate the Gini coefficient?
Sort the values, weight each by (2i − n − 1) where i is its rank, sum them, and divide by n times the total. This equals the area between the Lorenz curve and the line of equality divided by the total area under that line.
What is a high Gini coefficient?
For national income, values below 0.30 are low inequality (many European countries) and above 0.45 are high (several Latin American and southern African countries).
What is the sample-corrected Gini?
Multiplying by n ÷ (n − 1) removes the downward bias of the Gini in small samples, so a sample where one person has everything gives exactly 1.
Can the Gini coefficient be used outside economics?
Yes. Ecologists use it for size inequality in plant populations and data scientists use a related Gini impurity in decision trees.
Limitations
- Values must be non-negative and the total above zero; grouped data with unequal group sizes needs weighting.
References
- Gini C (1912). Bologna: Tipografia di Paolo Cuppini.
- World Bank Poverty and Inequality Platform.
Related reading
More Statistics
- Standard Deviation Calculator
- Mean, Median & Mode Calculator
- Variance Calculator
- Z-Score Calculator
- P-Value Calculator
- Confidence Interval Calculator
- T-Test Calculator
- Chi-Square Test Calculator
- Correlation Coefficient Calculator
- Linear Regression Calculator
- Normal Distribution Calculator
- Probability Calculator
All free tools · By Dr. Zubair Khalid, DVM, MS, PhD.