Gini Coefficient Calculator

Measure income inequality: integrate a Lorenz curve and read the Gini index off the shaded gap.

Gini Coefficient Calculator

Gini index from a Lorenz curve L(x) on [0, 1]: G = 1 − 2∫01 L(x) dx.

What Is the Gini Coefficient?

The Gini coefficient is the world's standard measure of inequality, a single number from 0 (perfect equality) to 1 (perfect inequality) that summarizes how unevenly a quantity like income or wealth is distributed. It is defined geometrically from the Lorenz curve L(x), which plots the cumulative share of total income held by the poorest fraction x of the population. The Gini is twice the area between the Lorenz curve and the diagonal line of perfect equality:

G = 1 − 2∫01 L(x) dx

When everyone earns the same, the Lorenz curve is the diagonal y = x and G = 0; the more the curve sags below the diagonal, the more income is concentrated at the top and the closer G climbs to 1. This calculator integrates any Lorenz curve you provide, checks that it is a valid Lorenz curve, reports the Gini coefficient, and interprets the result against real-world benchmarks.

How to Use the Gini Coefficient Calculator

Enter a Lorenz curve L(x) defined on [0, 1], a function satisfying L(0) = 0, L(1) = 1, non-decreasing, and lying on or below the diagonal. The steps validate these properties, integrate L, compute G = 1 − 2∫L, and interpret the value against ranges seen in real economies. The graph draws L below the line of equality with the inequality gap shaded, the shaded area is exactly half the Gini. This is an economics application of the definite integral, in the same applied-integral family as the consumer surplus calculator.

Worked Example

Take the Lorenz curve L(x) = x², a common textbook model. Integrating,

01 x² dx = 1/3,   so   G = 1 − 2(1/3) = 1/3 ≈ 0.333

A Gini of 0.33 describes moderate inequality, roughly the level of many developed economies. The curve L = x² means the poorest half of the population holds only 25% of total income (L(0.5) = 0.25), while the top half holds 75%. Sharpen the curve to L = x³ and the Gini rises to 1 − 2(1/4) = 0.5, high inequality: now the poorest half holds only 12.5%. The flat diagonal L = x gives G = 0, the socialist ideal where every percentile of population holds an equal percentile of income.

Why Twice the Gap

The factor of 2 makes the coefficient span the full [0, 1] range. The area between the diagonal and the Lorenz curve, call it B, can be at most the area of the triangle below the diagonal, which is 1/2. So B ranges from 0 (equality) to 1/2 (one person holds everything). Defining G = B/(1/2) = 2B rescales this to [0, 1], and since the triangle area is 1/2 and the area under L is ∫L, we get B = 1/2 − ∫L, hence G = 2B = 1 − 2∫L. This normalization is what lets Ginis be compared across countries and eras. The measure has real limitations that the geometry exposes: two very different distributions can share a Gini if their Lorenz curves enclose the same area while crossing, so the Gini can miss whether inequality is driven by a poor bottom or a rich top. That is why economists supplement it with the full Lorenz curve, percentile ratios, and measures like the Theil index, but the Gini remains the headline number precisely because it compresses an entire distribution into one interpretable integral.

Common Mistakes to Avoid

  • Using a curve that is not a valid Lorenz curve. L must start at (0,0), end at (1,1), be non-decreasing, and lie below the diagonal. A curve violating these gives a meaningless or negative Gini; the tool flags such inputs.
  • Forgetting the factor of 2. The Gini is twice the gap area, not the gap area itself. Omitting the 2 halves every result and breaks comparability with published figures.
  • Confusing the Gini with a percentage. A Gini of 0.4 is not "40% inequality" in any share sense; it is a normalized area. Reporting it as a percentage invites misinterpretation.
  • Assuming equal Ginis mean equal distributions. Crossing Lorenz curves can enclose the same area, giving identical Ginis for structurally different inequalities. The single number hides the shape.
  • Ignoring what is being measured. Income Gini and wealth Gini differ sharply (wealth is far more concentrated); a Gini is only meaningful once you know the underlying quantity and population.

Real-World Applications

The Gini coefficient is reported annually by the World Bank, the OECD, and national statistics agencies for essentially every country, making it the most cited inequality statistic in economics and policy. Governments track their Gini over time to gauge whether growth is being shared, and cross-country comparisons drive debates over taxation, welfare, and development strategy; Scandinavian economies cluster near 0.25 to 0.28, the United States near 0.4, and the most unequal economies exceed 0.6. Beyond income, the same integral measures inequality of wealth, land ownership, health outcomes, educational attainment, and firm sizes. Ecologists use the Gini to quantify biodiversity and size inequality among trees in a forest; the identical mathematics measures concentration of market share (a high Gini flags monopoly power), citation inequality among scientific papers, and even the unevenness of traffic or server loads in engineering. Because it reduces any distribution to a comparable [0, 1] score via one definite integral of a cumulative curve, the Gini has become a universal concentration index far beyond its economic origins. Its computation is a clean demonstration of how integration turns a whole distribution into a single actionable number.

Frequently Asked Questions

What does a Gini coefficient of 0 or 1 mean?

Zero means perfect equality: everyone holds an identical share, so the Lorenz curve is the diagonal. One means perfect inequality: a single individual holds everything while everyone else holds nothing, so the Lorenz curve hugs the bottom and right edges. Real economies fall between, typically 0.25 to 0.65.

What is the Lorenz curve?

It plots the cumulative share of total income (vertical) held by the poorest fraction of the population (horizontal). If the bottom 50% earn 25% of income, the curve passes through (0.5, 0.25). Perfect equality gives the straight diagonal; inequality bows the curve downward.

Why is the Gini twice the area between the curves?

The gap between the diagonal and the Lorenz curve ranges from 0 to a maximum of 1/2 (the triangle's area). Doubling it rescales the measure to the full [0, 1] interval, giving G = 2 × gap = 1 − 2∫L, which makes Ginis directly comparable.

Can two different distributions have the same Gini?

Yes. If two Lorenz curves cross but enclose equal areas against the diagonal, they yield identical Ginis despite representing different inequality patterns, one driven by a poor bottom, another by a rich top. This is the Gini's main limitation, addressed by examining the full curve.

What Gini values do real countries have?

The most equal economies (parts of Scandinavia and Eastern Europe) sit around 0.25 to 0.30; many developed nations including the US are near 0.35 to 0.42; and the most unequal countries in southern Africa and Latin America exceed 0.55 to 0.65. Wealth Ginis are much higher than income Ginis everywhere.

How is the Gini computed from real data rather than a formula?

With discrete income data, the Lorenz curve becomes a polygon through cumulative population-income points, and the integral becomes a sum of trapezoid areas (the trapezoidal rule). The continuous formula on this page is the idealized version; real computations discretize it over income brackets.

What makes a function a valid Lorenz curve?

Four conditions: L(0) = 0, L(1) = 1, L non-decreasing (cumulative shares only grow), and L convex, lying on or below the diagonal (each richer group adds at least as much as poorer groups). Any input violating these does not correspond to a real distribution.

Is the Gini used outside economics?

Widely. It measures market concentration (antitrust), citation inequality in science, size inequality of trees or firms, unevenness of server loads, and biodiversity. Anywhere a quantity is spread unevenly across a population, the Gini provides a normalized concentration score via the same Lorenz-curve integral.

How does the Gini differ from other inequality measures?

The Theil index (from information theory) is decomposable into within- and between-group inequality; percentile ratios (like the 90/10) compare specific points; the Palma ratio focuses on top-to-bottom shares. The Gini's strength is summarizing the whole distribution in one comparable number; its weakness is that summary hiding structure.

Does a higher Gini always mean a worse society?

Not necessarily. The Gini measures dispersion, not welfare: a country could raise everyone's income while increasing the Gini, or reduce the Gini through shared poverty. It is a descriptive statistic, and its policy meaning depends on context, growth, mobility, and absolute living standards alongside it.