Skip to main content
calculator

What will this sale actually cost me in tax?

Your gain, how long you held it, and the income it lands on, to the federal tax the sale causes in 2025 and the amount you keep. A long-term gain has no rate of its own: it stacks on top of your ordinary income and each slice is charged at the band it falls in, so this runs the whole return twice, with the sale and without it, and reports the difference. The same answer is available as JSON.

Published · 2026-08-22Updated · 2026-08-22By Tejas Shah, Co-founderModel · section 1(h), tax year 2025

Loading the calculator.

A long-term gain does not have a rate of its own

Every rate table says 0%, 15%, or 20%, and every one of them is describing a band rather than your sale. Section 1(h) works by stacking: your ordinary taxable income is measured first, the long-term gain sits on top of it, and each slice of that gain is charged at whatever band it lands in. Two people with an identical $50,000 gain and different salaries pay different amounts, and neither of them pays a single rate.

At the inputs above, $60,000 of other income filing single leaves $44,250 of ordinary taxable income after the $15,750 standard deduction. The 0% band runs to $48,350 of taxable income and the 15% band to $533,400, so your salary has already used part of the cheap room before the gain arrives. The result is $6,885 of federal tax on the sale, an effective 13.77% of the gain, which is not a number on any rate table.

This table holds the sale fixed at $50,000 held more than a year and changes only the income underneath it and the filing status. It is the comparison the rate tables cannot make.

Other incomeSingleMarried filing jointlyHead of household
$0$0$0$0
$40,000$3,885$0$244
$60,000$6,885$0$3,244
$120,000$7,500$6,270$7,500
$300,000$9,400$9,400$9,400

Every cell is two full returns, one with the sale and one without, and the difference between them. If you want to see what the income column alone does to your bill before any sale, that is the income tax calculator, and the marginal rate calculator measures what your next dollar of ordinary income costs.

One year and one day

The holding period is the largest lever on this page and the only one a calendar can still move. More than one year, counted from the day after you bought to the day you sold, and the gain gets the 0/15/20 bands. A year or less and it is added to your ordinary income and charged at the ordinary rate schedule, exactly like salary.

At the inputs above that is $6,885 against $10,580: a difference of $3,695 on the same $50,000, decided by the date on the confirmation rather than anything about the investment. A short-term gain also raises your ordinary taxable income, which can push other things around, so the cost is sometimes larger than the rate difference alone suggests.

One thing this does not mean: hold a losing position for tax reasons. The tax is a share of a gain, and a gain that evaporates while you wait for a date costs more than the tax ever would.

Where the 0% band actually ends

The 0% band is real, and it is the most misread line in the whole subject. It is measured on taxable income, not on the gain, and your ordinary income is counted first. Filing single for 2025, the 0% band runs out once taxable income reaches $48,350, which means ordinary income of about $64,100 before the deduction.

You can watch the boundary rather than take it on faith. The same $50,000 sale at $54,100 of other income costs $6,000. Move the income up by $10,000, to $64,100, and the same sale costs $7,500. Nothing about the sale changed. The room underneath it did.

This is why the timing question is usually about income rather than about the market. A year with a gap in earnings, a sabbatical, or an early retirement is a year with cheap room underneath a sale, and the room does not carry forward. If you are weighing the sale against a retirement account move in the same year, the two compete for the same room: the Roth conversion calculator prices the other side of that trade.

Two taxes the rate tables leave out

The 3.8% net investment income tax under section 1411 is a separate charge on top of the capital gain rates. It starts once modified AGI passes $200,000 for a single filer and applies to the smaller of your net investment income and the amount you are over. At the inputs above it comes to $0.

On a large sale it stops being small. A $600,000 gain at $200,000 of other income owes $102,543 at the capital gain rates, $22,800 of net investment income tax, and $3,314 of alternative minimum tax, for $128,657 in total. That is 21.44% of the gain, well above the 20% headline. The calculator reports all three separately because they are three different calculations of the same sale.

The alternative minimum tax appears here for the same reason it appears on an option exercise: the AMT exemption phases out against income, and a large gain is income. If you are holding incentive stock options as well, the AMT calculator prices that side, and the RSU calculator covers shares that vested as wages rather than as a capital asset.

Losses, and the $3,000 ceiling

A capital loss cancels a capital gain dollar for dollar, with no limit, and that is the first thing this calculator does with a carryover you enter. The limit shows up only afterwards: once the gain is gone, at most $3,000 of what remains comes off your other income in a year, under section 1211(b). Everything past that carries forward under section 1212(b), with no expiry, until a future gain absorbs it.

This prices one sale of one holding period. A year with both short-term and long-term trades nets them against each other on Schedule D first, short against short and long against long, and only the survivor is taxed. Run each character separately or use the net figure.

What the calculator will not do is tell you to harvest a loss. Selling something at a loss to shelter a gain is a real trade with a real cost, and a repurchase inside thirty days is a wash sale that disallows the loss entirely under section 1091. This page does not model wash sales and does not decide whether the trade is worth making.

What this calculator does not know

State tax. Several states charge capital gains as ordinary income, and one of them will take more than the federal bill on a large sale. Nothing here is a state figure. If you are in California or New York, the California calculator and the New York calculator price the state side, though they price income rather than a sale.

The special rates. Collectibles are charged at up to 28% and the depreciation you claimed on rental real estate comes back at up to 25% as unrecaptured section 1250 gain. Neither is modeled here, so a sale of art, coins, metals, or a rental property will cost more than this page says.

The exclusions. Section 121 lets most people exclude a large share of the gain on a home they lived in, section 1202 excludes qualified small business stock, and section 1031 lets investment real estate roll into a replacement property. Any one of them can take the tax on your sale to zero, and none of them is in this calculation.

The rest of the year. This prices one sale of one holding period against wage income and the standard deduction. It does not net short-term against long-term across a whole Schedule D, does not model installment sales or wash sales, does not itemize, and carries one tax year rather than a history of past ones. Everything here is federal, for tax year 2025, and none of it is tax advice.

For agents and scripts

This calculator is built to be used without a browser. Every input is a query parameter on this page, and the same parameters on the JSON twin return the complete answer as a document.

GET /tools/capital-gains.json?gain=50000&income=60000&holding=long&status=single

The response carries inputs after parsing and clamping, result with the federal tax the sale causes, split into rateTax, niit, and amt, what you keep after it, the effective and measured marginal rates, the bands the gain fell in with the headroom left in the current one, the loss carryover applied and what carries forward, total federal tax with and without the sale, the taxable income and breakpoints the bands are measured from, split for the same gain realized over two years, walk, the numbered lines the answer is built from, and sensitivity across a ladder of gain sizes, all five filing statuses, and both holding periods, drivers ranked by effect with a plain sentence each, assumptions that say for every field whether you supplied it and name the source when the default came from one, sources with a URL and an as-of date for each source the tool cites, which is an empty list on the calculators whose every default is an example input rather than a published figure, warnings, a disclaimer, and in tool the canonicalUrl and jsonUrl that carry only your non-default parameters. The canonical URL is the answer's permanent address; use it when you cite the number.

Parameters, all optional, in any order:

  • gain ($), default $50,000.
  • income ($ per year), default $60,000 per year.
  • losses ($), default $0.
  • holding (one of long, short), default long.
  • status (one of single, married-joint, married-separate, head-of-household, qualifying-surviving-spouse), default single.

Values accept plain numbers and loose human formats such as 100k, $100,000, or 6.5%. Unknown parameters are ignored, values outside a field's range are clamped and reported in warnings, and the endpoint never fails on bad input. Responses are cacheable for a day; the defaults change when their sources publish, and tool.version changes when the method does.

Common questions

How much tax will I pay on a $50,000 capital gain?

It depends on what else you earn, which is the part most rate tables leave out. On $60,000 of other income filing single, a $50,000 gain held more than a year costs $6,885 in federal tax for 2025, so you keep $43,115. The same sale at $300,000 of other income costs $9,400. Nothing about the sale changed; the income underneath it did.

How long do I have to hold something to get the lower rate?

More than one year, counted from the day after you bought to the day you sold. One day short and the whole gain is short-term and taxed like salary. At the inputs above that difference is worth real money: $6,885 long-term against $10,580 short-term, a gap of $3,695 on the same $50,000. This is the one lever on the page a calendar can still move.

Is the capital gains rate 0%, 15%, or 20%?

All three, on the same sale. Section 1(h) stacks your long-term gain on top of your ordinary taxable income and charges each slice at the band it lands in. Filing single, the 0% band runs until taxable income reaches $48,350 and the 15% band until $533,400. Your other income uses that room up first, which is why the answer is a blend rather than a rate. This calculator shows which bands your gain actually fell in.

What is the 3.8% net investment income tax?

A separate tax under section 1411, on top of the capital gain rates rather than instead of them. It applies to investment income once modified AGI passes $200,000 for a single filer. At the inputs above the surtax is $0. On a larger sale it stops being a rounding error: a $600,000 gain at $200,000 of income owes $22,800 of surtax on top of $102,543 of capital gain tax. Most rate tables do not mention it at all.

Can capital losses cancel my gain?

Dollar for dollar, yes, and that is the first thing this calculator does with a loss carryover. What is left over after the gain is gone comes off your other income, but only up to $3,000 a year under section 1211(b). Anything past that carries forward under section 1212(b) with no expiry. This prices one sale of one holding period. A year with both short-term and long-term trades nets them against each other on Schedule D first, short against short and long against long, and only the survivor is taxed. Run each character separately or use the net figure.

Does splitting a sale across two years cost less?

Sometimes, and the calculator prices it rather than assuming. Selling half this year and half next, at the same other income and the same law, costs $6,270 against $6,885 in one go: a saving of $615. It works when the gain crosses a band boundary or a surtax threshold, and it does nothing when the whole gain already sits inside one band. Next year's law and next year's income are assumptions, not facts.

Can an agent or a script use this calculator?

Yes, and it is the same computation the page runs. Every input is a query parameter, and the same parameters on /tools/capital-gains.json return the full answer as JSON: the parsed inputs, the tax the sale causes split into the capital gain tax, the 3.8% surtax and any alternative minimum tax, what you keep, the bands the gain fell in with the room left in the current one, a measured marginal rate on the next $1,000, the numbered line walk, the two-year split, drivers, the same sale under every filing status and both holding periods, assumptions with their sources, and warnings. The page itself reads that endpoint, so the agent surface cannot quietly drift from the human one.

Sources

  • IRS Rev. Proc. 2024-40 (2025 inflation-adjusted items), as of 2025-01-01. Section 2.03 sets the taxable-income breakpoints where the 0%, 15%, and 20% capital gain rates start for 2025, and section 2.01 sets the ordinary rate tables a short-term gain is charged at.
  • One Big Beautiful Bill Act (P.L. 119-21), as of 2025-07-04. The statute that sets the current standard deduction, which is subtracted before any of the capital gain bands are measured for 2025.
  • 26 U.S.C. (Internal Revenue Code), as of 2025-01-01. The sections this calculation implements: § 1(h) the 0/15/20 rates on net capital gain, § 1222 the more-than-one-year holding period, § 1211(b) and § 1212(b) the capital loss limit and carryforward, § 1411 the 3.8% net investment income tax, and § 55 the alternative minimum tax.
  • IRS Topic no. 409, Capital gains and losses, as of 2025-01-01. The IRS statement of the one-year holding period, the 0/15/20 rate structure, the 28% collectibles and 25% unrecaptured section 1250 rates this tool does not model, and the $3,000 annual limit on deducting net capital losses against other income.

These are the parameter authorities the engine itself reports for every computation, not citations chosen after the fact. The breakpoints where each capital gain rate starts, the standard deduction they are measured after, and the surtax threshold come from the IRS revenue procedure and the statute that set them; the code sections are the rules the calculation implements. When the engine loads a different parameter set, this list changes with it.

Want the number for your actual finances?

Carlo is a personal finance agent. It knows your accounts, debts, and goals, so instead of a worked example at the gain you typed it can watch your actual income through the year, and tell you in November how much cheap room is left underneath a sale before December 31 closes it. Text it the question.

ask carlo anything(415) 376-5678

Other calculators

Federal income tax calculator
Wages, filing status, and children under 17 to the federal income tax for the year, walked down the numbered Form 1040 lines that produce it.
What is my take home pay?
Salary, filing status, and state to the take home pay on each paycheck, with federal tax, Social Security, Medicare, and state tax named separately.
What will I owe in California income tax?
Income and filing status to the California income tax for the year, walked down the numbered Form 540 lines, with SDI and the federal total beside it.
What will I owe in New York State and New York City income tax?
Income, filing status, and whether you live in the city to New York State tax plus the NYC resident tax, on the numbered IT-201 lines.
How are bonuses taxed?
Salary and bonus to what your employer withholds at the flat rate, next to the federal tax the same bonus really adds to the year.
What tax bracket am I in, and what is my real rate?
Income, filing status, and children to the bracket you are in and the true marginal rate, with credit phase-outs counted as the rate they are.

Every calculator is on one page, and each one answers at the same address in JSON.

Written by Tejas Shah, Co-founder, Engineering. Building Carlo, the financial model that begins with the decision you're actually weighing. Previously engineering leadership across fintech and consumer startups.

This computes the federal tax that one sale of a capital asset causes in tax year 2025, against wage income and the standard deduction. It leaves out state and local tax, the 28% rate on collectibles and the 25% rate on unrecaptured section 1250 real estate gain, the section 1202 qualified small business stock exclusion, the section 121 home-sale exclusion, section 1031 exchanges, wash sales, installment sales, and Schedule D netting across holding periods, so it is not your return and not tax advice. Check anything that matters against your own filing.