Gini In A Bottle

How do you measure inequality? Economists use the Gini coefficient. It's a useful metric, but I've always thought it's extremely hard to grasp. It compresses an infinite spectrum of possibilities—perfect balance through unimaginable inequality—into the tiny range of zero to one. This visualization aims to make the Gini coefficient concrete. Move the slider: you'll see 1,000 circles with unequal areas, reflecting that Gini coefficient. The area of all the circles put together remains the same. For reference, I've added Gini values for income distribution in a few countries (hover for labels).

πŸ‡ΏπŸ‡¦ .63
πŸ‡―πŸ‡² .53
πŸ‡²πŸ‡½ .46
πŸ‡ΊπŸ‡Έ .41
πŸ‡¬πŸ‡§ .35
πŸ‡ΈπŸ‡ͺ .30
πŸ‡ΈπŸ‡° .23

What's going on in the visualization? Think of the circles as representing income. The area of each circle would correspond to one person's income. As you move the slider towards 1, income becomes more concentrated among fewer individuals, resulting in greater inequality. You can see that small numerical variations in Gini values make a big visual difference.

The goal of the visualization is to provide intuition for the scale of Gini values. I haven't put the mathematical definition front and center—after all, I use Fahrenheit temperatures every day, despite having no idea how they're defined. Feel free to stop reading now!

So how is the Gini coefficient calculated? Consider common statistics like "The bottom 10% owns just 1% of wealth" or "The bottom 50% owns 25%." Each comparison reveals inequality at a different scale: the poorest 10% have 90% less than their "fair share," while the bottom half have 50% less of theirs. But which measure of inequality, 90% or 50%, is the right one? Worse yet, we could come up with infinitely many statistics based on "the bottom X% of people have Y% of the money." Which should we use?

Economists have a clever answer to that question: we should use all of those statistics! Just average them together, giving more weight to larger population segments. That weighted average, expressed as a number between 0 and 1, is the Gini coefficient.

If you plot a graph with the x-axis representing the bottom X% of the population, and the y-axis how much they own, you get something called the Lorenz curve, in red. Geometrically, the weighted average I just described is equal to the ratio of the area between the red curve and the diagonal (light gray) to the area under the diagonal (light gray plus dark gray).

There's a lot more that can be said about the Gini coefficient. I recommend this essay from Our World In Data if you're interested.

Fine print: The Gini coefficients in the slider come from Statistica, and represent income inequality values for 2023. The distribution of circle areas in the visualization uses something called a power law. This is a reasonable choice, since people have long used power laws as a simplified model of wealth and income statistics. Of course, real-world numbers are more complex, and economists continue to debate the best model.

This page was built by Martin Wattenberg.