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

  1. Paste the values (one per person, household or group).
  2. Read the Gini coefficient and the corrected value for small samples.
  3. Check the Lorenz curve against the line of equality.

What you enter

What you get

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

References

Related reading

More Statistics

All free tools · By Dr. Zubair Khalid, DVM, MS, PhD.