Federal figures use tax year 2026 long-term thresholds (IRS Revenue Procedure 2025-32): 0% up to $49,450 single, $98,900 joint, $66,200 head of household, $49,450 separate; 20% above $545,500 single, $613,700 joint, $579,600 head of household, $306,850 separate. The net investment income tax of 3.8% applies above $200,000 of modified AGI ($250,000 joint). State tax is entered, because states treat capital gains very differently: some tax them as ordinary income, some exclude them, and no single rate covers them. Short-term gains are taxed as ordinary income, so the page uses your entered marginal rate rather than inventing a bracket for you. Collectibles and unrecaptured real-estate depreciation carry special maximum rates (28% and 25%) and are not modelled here.
| Line | Amount |
|---|
Disclaimer: This calculator gives estimates for general information only. It is not financial, medical or other professional advice, and it is not tax advice. Capital gains tax depends on the full return, including loss carryforwards, depreciation recapture and state rules; confirm the result with a tax professional before acting on it.
What this calculator does
Works out the tax on a sale from the dates, the proceeds, the adjusted basis and the selling costs: it classifies the gain as short-term or long-term from the holding period, applies the primary-residence exclusion where it qualifies, prices a wash sale where replacement shares were bought inside 30 days, stacks a long-term gain on top of other taxable income through the 0%, 15% and 20% bands, adds the 3.8% net investment income tax where it applies, and adds an entered state rate, ending with after-tax proceeds.
How to use it
- Get the holding period right first: long-term means held for more than one year, measured from the day after acquisition to the sale date. Selling on the one-year anniversary is still short-term, and the difference between short-term and long-term tax on the same gain can be thousands of dollars, which is why the dates are inputs rather than a toggle.
- Enter other taxable income honestly: the long-term bands apply to total taxable income, not to the gain alone. Other income fills the 0% band first, so a gain that looks tax-free on its own can be fully taxable at 15% once salary is counted, and the page stacks the gain on top of the entered figure for exactly that reason.
- Use the home exclusion only when it qualifies: the exclusion needs ownership and use as a main home for two of the last five years. It is $250,000 single and $500,000 joint, and it applies to the gain, not to the proceeds: a $600,000 sale with a $365,000 basis has a $235,000 gain, which a single filer excludes entirely.
The method
Gain or loss = proceeds minus adjusted basis minus selling costs. Holding period is measured against the one-year anniversary of acquisition: a sale after that anniversary date is long-term, on or before it is short-term, so a leap-year span is judged by the calendar, not by counting 365 days. Primary-residence exclusion = the smaller of the gain and $250,000 (single or separate) or $500,000 (joint) when the asset is a primary residence, the ownership-and-use test is met, and the gain is positive; head of household uses $250,000. Wash sale: when the result is a loss and replacement shares were bought within 30 days, the disallowed loss = the loss times replacement shares divided by shares sold, capped at the full loss; the allowed loss is the remainder, and the disallowed amount is added to the replacement shares’ basis (shown as a note, since the replacement basis itself is not an output of this page). Long-term federal tax stacks the taxable gain on other taxable income: the part below the 0% threshold is taxed at 0%, the part above the 20% threshold at 20%, the rest at 15%. Net investment income tax = 3.8% of the smaller of the taxable gain and modified AGI above $200,000 single, $250,000 joint ($200,000 separate and head of household), where modified AGI here is other taxable income plus the taxable gain. Short-term federal tax = taxable gain times the entered marginal rate. State tax = taxable gain times the entered state rate. After-tax proceeds = proceeds minus selling costs minus total tax; a loss shows as a negative tax line only through the wash-sale and loss figures, since losses offset other gains on the return rather than producing a refund here.
Worked examples
Long-term stock sale: bought January 15, 2023, sold June 1, 2025, proceeds $50,000, basis $30,000, fees $500, other income $60,000, single. Gain $19,500.00, long-term. Other income already exceeds the $49,450 0% threshold, so the whole gain falls in the 15% band: federal tax $2,925.00. Modified AGI $79,500 is below the $200,000 net investment threshold, so no surtax. After-tax proceeds $46,575.00.
Same sale held short-term: bought January 15, 2025, sold June 1, 2025. Gain $19,500.00, short-term, taxed at the entered 22% marginal rate: federal tax $4,290.00, which is $1,365.00 more than the long-term result on the identical gain. The holding period alone is worth more here than any fee negotiation.
Home sale: proceeds $600,000, basis $300,000, improvements $50,000, fees $15,000, owned and used 2 of 5 years, single. Gain $235,000.00, fully covered by the $250,000 exclusion: taxable gain $0.00, federal tax $0.00. Without the exclusion the same gain at 15% would cost $35,250.00, which is why the ownership-and-use test is worth checking before a sale rather than after it.
Wash sale: proceeds $8,000, basis $10,000, loss $2,000.00, 100 shares sold, 50 replacement shares bought within 30 days. Disallowed loss $1,000.00, allowed loss $1,000.00, and the $1,000.00 disallowed amount is added to the replacement shares’ basis. Selling the replacement shares later without another wash sale releases the deferred loss then, which is the point of the rule: it defers the loss, it does not destroy it.
Reading your result
Read the gain first and ask whether it is the right gain: basis errors, forgotten improvements and uncounted selling costs are the three usual mistakes, and each one moves the tax dollar for dollar at the marginal rate. Then read the band split: a gain split across 0% and 15% means part of the gain was sheltered by unused low-band room, and realising the gain in a lower-income year would shelter more of it. Then read the after-tax proceeds against the proceeds: that gap is the true cost of selling now, and it is the figure to compare against waiting for a longer holding period or a lower-income year.
Limitations
- Federal estimate, not a return: loss carryforwards, capital loss limits ($3,000 a year against ordinary income), depreciation recapture, installment sales and qualified small business stock are not modelled. A return with any of those will differ from this page.
- Collectibles and depreciation excluded: gains on collectibles carry a 28% maximum rate and unrecaptured section 1250 gain a 25% rate; this page prices the standard 0/15/20 framework only and says so rather than mispricing those assets.
- State rate entered: state capital gains treatment ranges from full exemption to ordinary-income rates with their own exclusions; the entered rate is a planning assumption, not a lookup.
- Wash sale simplified: the page prices one sale and one replacement purchase. Real wash sales span multiple lots, IRAs and spouses’ accounts, and the full rule needs lot-level records the page does not keep.
Frequently asked questions
What counts as long-term?
More than one year, measured from the day after you acquire the asset to the sale date. Exactly one year is short-term. The distinction matters because long-term gains use the 0%, 15% and 20% bands while short-term gains are taxed as ordinary income.
Why does other income change my capital gains tax?
Because the bands apply to total taxable income. Other income fills the 0% band first, so a gain realised on top of a high salary is taxed at 15% or 20% from the first dollar, while the same gain in a low-income year can fall partly or entirely in the 0% band.
What is the home sale exclusion?
A primary residence owned and used as a main home for two of the last five years excludes up to $250,000 of gain ($500,000 joint) from federal tax. It applies once every two years, and it covers the gain, not the sale price.
Does a wash sale erase my loss?
No, it defers it: the disallowed loss is added to the basis of the replacement shares, so it is recognised when those shares are sold without another wash sale. Buying the same security within 30 days before or after the sale triggers the rule.
Related calculators
- Money and finance calculators
- Income Tax and Refund Calculator
- Stock Return Calculator
- Home Sale Proceeds Calculator
Method: gain = proceeds minus adjusted basis minus selling costs; holding period by calendar dates, more than one year is long-term; 2026 federal long-term thresholds (Rev. Proc. 2025-32) stacked on other taxable income at 0%, 15% and 20%; net investment income tax 3.8% above $200,000 ($250,000 joint); short-term at the entered marginal rate; home exclusion $250,000 ($500,000 joint) on ownership and use of 2 of 5 years; wash sale disallowance by replacement share ratio within 30 days; state at the entered rate. Last reviewed: 24 October 2026.
