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).
Formula
Steps
- 1Draw 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.
- 2Identify 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.
- 3Find 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.
- 4Find Area A. Subtract: A = 0.5 − B, since the whole triangle under the line of equality has area 0.5.
- 5Divide 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
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.
Frequently asked 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.