Gini before vs after tax
Measure how much taxes and transfers even out incomes: in the example, the Gini falls from 0.4 before tax to 0.175 after, a reduction of 0.225 that removes 56.25% of pre-tax inequality. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Pre tax
- 10, 20, 30, 40, 100
- Post tax
- 20, 25, 30, 35, 50
- N
- 5
- Total pre tax
- 200
- Total post tax
- 160
- Mean pre tax
- 40
The Gini coefficient is the standard zero-to-one score of income inequality: zero when every household has the same income and almost one when a single household holds everything. A tax-and-transfer scheme is redistributive when disposable income is more equal than market income, and the drop in Gini between those two lists is the Reynolds-Smolensky index used in public-finance textbooks. This Gini before-versus-after-tax calculator takes a pre-tax income list and a matching post-tax list after taxes and transfers, then returns both Gini coefficients, the absolute reduction, and the percentage of pre-tax inequality removed. Progressive systems produce a positive reduction; a proportional flat tax leaves Gini unchanged because the index is scale-free; a regressive scheme can raise Gini and report a negative reduction.
What Gini reduction measures in a tax-and-transfer scheme
The Gini coefficient of an income list is a single number between zero and almost one that answers how far the distribution sits from perfect equality. Rank the observations from poorest to richest, form the Lorenz curve of cumulative population share against cumulative income share, and Gini is twice the area between that curve and the forty-five-degree line of equality.
In the discrete unweighted form used here the same number is obtained without drawing the curve: sort the n incomes from smallest to largest, then G equals two times the rank-weighted income sum divided by n times total income, minus (n plus one) over n. Zero means every unit has the same income. The finite-sample maximum is (n minus one) over n, reached when one unit holds the entire pie and the rest have nothing.
Public-finance analysts apply that formula twice: once to market or pre-tax income and once to disposable or post-tax income after taxes and transfers. The difference G pre minus G post is the Reynolds-Smolensky index of redistributive effect. A progressive tax-and-transfer scheme compresses the upper tail and lifts the lower tail, so post-tax Gini falls and the index is positive.
A purely proportional levy scales every income by the same factor; because Gini is scale-invariant the two coefficients match and the measured reduction is exactly zero even though cash left the household. A regressive scheme can raise Gini and produce a negative reduction, which this calculator reports honestly rather than clamping at zero. Relative redistribution divides the absolute drop by pre-tax Gini when that Gini is strictly positive, so you can say what share of observed market inequality the fiscal system removed.
What you can do with it
Public-finance homework and exams
Students paste a market-income list and a disposable-income list to verify both Ginis and the Reynolds-Smolensky reduction against a textbook worked example.
LMS and exam auto-grading
Mark redistribution items with a deterministic oracle that rejects mismatched lengths and negative incomes instead of inventing a Gini from a broken vector.
Policy notebooks and microsimulation extracts
Batch-compare pre-tax and post-tax inequality for several reform scenarios without spreadsheet formula drift on the rank-weighted Gini step.
FAQ
What is the Reynolds-Smolensky index?
It is the absolute drop in Gini between market (pre-tax) income and disposable (post-tax) income: G_pre minus G_post. A positive value means the fiscal system reduced inequality; a negative value means it increased it.
Does a flat proportional tax reduce the Gini coefficient?
No. Gini is scale-invariant, so multiplying every income by the same factor (1 minus the flat rate) leaves Gini unchanged and the measured reduction is zero. Redistribution requires progressivity, transfers, or both.
Why must the pre-tax and post-tax lists have the same length?
Different lengths would compare two unrelated samples and would not measure the redistributive effect of a tax-and-transfer scheme on those units.
Is the Gini before-and-after-tax calculator free?
The browser tool runs free on your device.
What does a Gini reduction of 0.225 mean?
It is the drop from a pre-tax Gini of 0.4 to a post-tax Gini of 0.175. Divided by the pre-tax figure, it shows that taxes and transfers removed 56.25% of the measured inequality.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/econ/gini-tax-redistribution \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"pre_tax":[10,20,30,40,100],"post_tax":[20,25,30,35,50]}'const res = await fetch("https://api.kit.forhosting.com/econ/gini-tax-redistribution", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"pre_tax": [
10,
20,
30,
40,
100
],
"post_tax": [
20,
25,
30,
35,
50
]
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/econ/gini-tax-redistribution",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"pre_tax": [
10,
20,
30,
40,
100
],
"post_tax": [
20,
25,
30,
35,
50
]
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/econ/gini-tax-redistribution", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"pre_tax":[10,20,30,40,100],"post_tax":[20,25,30,35,50]}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"pre_tax":[10,20,30,40,100],"post_tax":[20,25,30,35,50]}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/econ/gini-tax-redistribution", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"pre_tax": [
10,
20,
30,
40,
100
],
"post_tax": [
20,
25,
30,
35,
50
]
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "econ.gini_tax_redistribution",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
max_items | 10000 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
The arithmetic is fully deterministic, runs free in your browser, and is available over the API at $0.002 per successful request, with no language model and no external statistics service on the hot path.
What Gini reduction measures in a tax-and-transfer scheme
That relative figure is omitted when pre-tax Gini is zero, because dividing by zero is undefined and this API never invents a non-number.
How this calculator validates incomes and computes both Ginis
Optionally send decimals as an integer from zero through twelve, default six, to control half-up rounding on every reported numeric field. After validation the core sorts each list independently, forms the rank-weighted income sum, and applies the discrete Gini formula; an all-zero list is treated as perfect equality rather than a division by zero. Call the capability with two required arrays of the same length: pre_tax (market or gross income) and post_tax (disposable income after taxes and transfers). Each list needs at least two non-negative finite numbers and at most ten thousand entries, one value per person or household, paired by index so unit i has pre_tax i and post_tax i. The engine also accepts the aliases pretax, market_income, gross_income, and before_tax on the first list, and posttax, disposable_income, net_income, and after_tax on the second, so scripts that already speak in those terms do not need a rename step. Validation rejects a missing field, a non-array, a list shorter than two, lists of different lengths, lists longer than the published maximum, any entry that is not a finite number, and any negative entry, all with invalid_input and without charging balance. The response reports n, totals and means on both sides, gini_pre_tax, gini_post_tax, gini_reduction, the same reduction under the name reynolds_smolensky, a boolean inequality_reduced, and the formula string. When pre-tax Gini is strictly positive it also returns relative_redistribution and gini_reduction_percent.
Practical use, limits, pricing, and delivery
Use the browser tool when you want an immediate Gini before-versus-after-tax check while grading a public-finance homework answer, comparing a progressive schedule with a flat levy, or explaining why a proportional tax does not change Gini even though it collects revenue. Results are fully deterministic: the same two lists always yield the same Ginis, the same Reynolds-Smolensky reduction, and the same optional relative fields. There is no language model, no external statistics service, and no randomness, so the capability is safe to pin in continuous-integration checks and reproducible lesson materials. Each successful request is one billable item at $0.002; failed validation does not consume balance. Accepted lists stay bounded for Worker isolates: up to ten thousand incomes per side cover classroom tables, survey extracts, and typical microsimulation excerpts while still finishing quickly. Wire the endpoint into inequality tutorials, spreadsheet-migration tests, coding-interview sandboxes for economists, or preprocessing steps where you already prefer a closed-form Gini reduction over opaque black-box calculators that hide whether they use population weights, sample weights, or a different discrete convention. Pair this landing with a coefficient-of-variation or concentration-ratio check when you need a fuller inequality dashboard; this endpoint certifies only the Gini comparison of two non-negative income lists and the Reynolds-Smolensky reading of that comparison.
Technical questions
How do I calculate the Gini reduction from a tax-and-transfer scheme?
Send JSON with pre_tax and post_tax (two same-length arrays of at least two non-negative numbers) to econ.gini_tax_redistribution. The response returns gini_pre_tax, gini_post_tax, gini_reduction (the Reynolds-Smolensky index), and, when pre-tax Gini is positive, gini_reduction_percent.