Gini coefficient calculator
Calculate the Gini coefficient and cumulative Lorenz curve coordinates from income observations. Your inputs stay on your device.
Set up your task
Starting local processing
Ready. Processing stays in this browser.
2 Your result
Your result updates in this browser. Check your input if the result looks unexpected.
How to use Gini coefficient calculator
Calculate the Gini coefficient and cumulative Lorenz curve coordinates from income observations. The example below shows the input values and the result so you can compare the calculator’s method with your own working.
- Start with the pre-filled values for income observations (space or comma separated).
- Replace the example with your own coursework values. Keep units consistent across the inputs and compare with the stated model.
- Read the intermediate values in the result. Use the check below to see how a change in the assumptions affects the answer.
Supported inputs and limits
Enter up to 80 non-negative observations with equal population weights. At least one value must be positive.
How it works
The Lorenz curve plots the share of total income received by the poorest fraction of the population. Sort observations from lowest to highest, then accumulate their income shares. The diagonal represents perfect equality because any fraction of people receives the same fraction of income.
The Gini coefficient equals one minus twice the area under the Lorenz curve. This calculator connects the cumulative points with straight segments and sums the trapezoid areas. Each row has equal population weight. The same coefficient is also shown on a 0–100 scale, which makes it easier to compare with publications that report a Gini index instead.
Example
The pre-filled example gives “Gini coefficient: 0.416666667” as its first result.
- Income observations (space or comma separated)
- 0 10 20 30
Gini coefficient: 0.416666667 Gini index (0–100): 41.6666667 Area under Lorenz curve: 0.291666667 Cumulative population share · Cumulative income share 0% 0% 25% 0% 50% 16.6666667% 75% 50%
Questions about Gini coefficient calculator
Can I use grouped or weighted survey data?
Use one observation for each equally weighted unit. Survey weights and grouped population shares need a weighted Lorenz calculation.
Why can a small sample not reach exactly one here?
Even if one observation receives all income, that recipient represents a positive share of the population. For n observations the largest unadjusted coefficient is 1 − 1/n.
What happens if every observation has the same positive income?
The Lorenz points lie along the equality diagonal. The area is one half and the Gini coefficient is zero.
Related tools
Last updated