EconLearn

How to Calculate the Gini Coefficient

The Gini coefficient equals the area between the line of equality and the Lorenz curve (A) divided by the total area under that line: Gini = A ÷ (A + B).

The Gini Coefficient formula

Gini = Area A ÷ (Area A + Area B) = Area A ÷ 0.5 = 2 × Area A (where A = area between the line of equality and the Lorenz curve, B = area under the Lorenz curve, and A + B = 0.5 on a unit square)

Calculator

Enter cumulative income shares by quintile to get areas A and B and the Gini coefficient.

Share of all income earned by the poorest fifth.

Cumulative, so this includes the bottom 20% already entered above.

The bottom 100% always earns 100%, so the final point is fixed at 100 and needs no input.

Gini coefficient
0.464

Gini = A ÷ 0.5 = 2 × A, so 0.464 measures how far the Lorenz curve bows below the line of equality, where 0 is perfect equality and 1 is perfect inequality.

Area B (under the Lorenz curve)
0.268

Five trapezoids of width 0.2, each w × (h1 + h2) ÷ 2, added together.

Area A (equality line minus Lorenz curve)
0.232

A = 0.5 − B, because the triangle under the 45-degree line always has area 0.5.

Inequality reading
Typical for a real economy (0.25 to 0.65)

How to calculate Gini Coefficient, step by step

  1. 1
    Draw the Lorenz curve and the line of equality. Plot cumulative share of population on the x-axis and cumulative share of income on the y-axis, both from 0 to 1 (or 0% to 100%). The 45-degree line is the line of perfect equality; the Lorenz curve bows below it.
  2. 2
    Identify areas A and B. Area A is the gap between the line of equality and the Lorenz curve; Area B is the area under the Lorenz curve. Together they fill the triangle beneath the line of equality, so A + B = 0.5.
  3. 3
    Find Area B under the Lorenz curve. Estimate B by splitting it into trapezoids between each data point. For a segment of width w with heights h1 and h2, the trapezoid area is w × (h1 + h2) ÷ 2. Add the segments.
  4. 4
    Find Area A. Subtract: A = 0.5 − B, since the whole triangle under the line of equality has area 0.5.
  5. 5
    Divide to get the Gini coefficient. Gini = A ÷ (A + B) = A ÷ 0.5, which is the same as 2 × A. The result is a number between 0 and 1.

Worked example: Gini Coefficient

Suppose cumulative income shares by population quintile are: bottom 20% earn 4%, 40% earn 12%, 60% earn 24%, 80% earn 44%, and 100% earn 100% (using decimals: 0.04, 0.12, 0.24, 0.44, 1.00). Compute Area B with five trapezoids of width 0.2: segment 1 = 0.2 × (0 + 0.04) ÷ 2 = 0.004; segment 2 = 0.2 × (0.04 + 0.12) ÷ 2 = 0.016; segment 3 = 0.2 × (0.12 + 0.24) ÷ 2 = 0.036; segment 4 = 0.2 × (0.24 + 0.44) ÷ 2 = 0.068; segment 5 = 0.2 × (0.44 + 1.00) ÷ 2 = 0.144. Sum: B = 0.004 + 0.016 + 0.036 + 0.068 + 0.144 = 0.268. Then Area A = 0.5 − 0.268 = 0.232, so Gini = 0.232 ÷ 0.5 = 0.464.

Gini Coefficient questions

What does the Gini coefficient tell you?

It measures income inequality on a scale from 0 to 1. A value of 0 means perfect equality (everyone has the same income and the Lorenz curve sits on the line of equality), while a value of 1 means perfect inequality (one person has all the income). Higher values mean income is distributed more unequally.

Why is the total area (A + B) always 0.5?

The line of equality is the 45-degree line across a 1-by-1 square, so the triangle beneath it has area (1 × 1) ÷ 2 = 0.5. Areas A and B together fill exactly that triangle, so A + B = 0.5 no matter the shape of the Lorenz curve. That is why Gini = A ÷ 0.5 = 2 × A.

Can the Gini coefficient ever be exactly 0 or 1?

In theory yes, but not in the real world. A Gini of 0 would require every household to earn identical income, and a Gini of 1 would require a single household to earn all income while everyone else earns nothing. Real economies fall in between, often roughly 0.25 to 0.65.

How is the Gini coefficient related to the Lorenz curve?

The Gini coefficient is calculated directly from the Lorenz curve. The more the Lorenz curve bows away from the line of equality, the larger Area A becomes and the higher the Gini coefficient, signaling greater inequality.

Get AP Econ exam tips in your inbox

Occasional emails with study tips, new interactive graphs, and exam-season reminders. Free, no spam.

No spam. Unsubscribe anytime. Read our privacy policy.

Keep track of what you have studied

A free EconLearn account adds progress tracking, your quiz history, and achievements. Studying here is free either way, and there is nothing to pay for as a student.

Create a free account

Already have one? Sign in

Last updated

AP® is a trademark registered by the College Board, which is not affiliated with, and does not endorse, EconLearn.