How to use the capital gains calculator
- Enter the sale: proceeds, what you paid, and any buying and selling fees.
- Enter days held: more than 365 days is long-term.
- Pick your filing status and enter your other income for the year, or type a flat rate to override.
- Read the result: gain, tax by rate band, net investment income tax and what you keep.
How the gain and the tax are worked out
The gain is net proceeds minus adjusted basis. Net proceeds are the sale price less selling costs such as broker or agent fees. Adjusted basis is what you paid plus buying costs and, for property, the cost of improvements. A negative result is a loss and produces no tax here.
Held more than a year (this tool counts more than 365 days), the gain is long-term and is taxed at 0%, 15% or 20% depending on where it sits on top of your other taxable income. Held a year or less, it is short-term and taxed like wages at your ordinary bracket rates. This capital gains tax calculator uses the federal rules when the flat-rate box is blank. Enter a percentage there if you would rather apply one rate yourself, for example your federal rate plus state tax.
2026 federal thresholds used
All figures are for tax year 2026 from IRS Rev. Proc. 2025-32, using the standard deduction for your filing status (single $16,100, married filing jointly $32,200, head of household $24,150). Long-term gains fill the bands above your other taxable income:
| Filing status | 0% up to taxable income of | 15% up to | 20% above |
|---|---|---|---|
| Single | $49,450 | $545,500 | $545,500 |
| Married filing jointly | $98,900 | $613,700 | $613,700 |
| Head of household | $66,200 | $579,600 | $579,600 |
Short-term gains use the ordinary rates of 10%, 12%, 22%, 24%, 32%, 35% and 37%. A 3.8% net investment income tax applies to the lesser of the gain and the amount your income exceeds $200,000 (single or head of household) or $250,000 (married filing jointly). Those NIIT thresholds are set by statute and are not indexed.
Worked examples
Long-term, moderate income. A single filer with $60,000 of other income sells shares for $50,000 that cost $20,000 and were held 400 days. Taxable income before the sale is $60,000 minus $16,100 = $43,900. The first $5,550 of the $30,000 gain fits under the $49,450 line and is taxed at 0%; the other $24,450 is taxed at 15%. Federal tax: 3,667.50.
Same sale held 100 days. It is short-term, so the $30,000 is taxed at the 12% and 22% brackets and the tax is 5,950. The holding period moved the bill by $2,282.50.
Large gain, higher income. A single filer with $400,000 of other income sells for $300,000 an asset that cost $100,000. Taxable income before the sale is $383,900, so $161,600 of the $200,000 gain is taxed at 15% and $38,400 at 20% ($31,920), and the 3.8% NIIT adds $7,600 because income is far over $200,000: total 39,520.
Mistakes that change the answer
Forgetting costs. Commissions and closing costs reduce the gain on both ends. Wrong basis. Inherited assets generally take the market value at the date of death as basis, and gifts carry the giver's basis. Reinvested dividends add to the basis of fund shares. Wash sales. Selling at a loss and buying the same security within 30 days before or after disallows the loss for now. Home sales. Many homeowners can exclude up to $250,000 of gain ($500,000 jointly) on a main home, which this tool does not apply. Special rates. Collectibles, unrecaptured depreciation on real estate and some small-business stock have different rates and are not modelled.
Method and sources
Method used by this capital gains tax calculator: ordinary tax uses the 2026 bracket tables of Rev. Proc. 2025-32 on taxable income = other income plus gain minus the standard deduction. Long-term gain is stacked on top of that income, filling the 0%, 15% and 20% bands; short-term gain is taxed as the difference in ordinary tax with and without it. Any unused part of the standard deduction (when your other income is below it) shelters the gain before it is taxed, so the taxable total is other income plus gain minus the standard deduction, never below zero. Sources: IRS Rev. Proc. 2025-32 (sections 4.01 to 4.03, read from the IRS PDF) and Internal Revenue Code section 1411. Not modelled: state tax, itemized deductions, capital loss carryovers, qualified dividends, AMT and credits. These tax-year figures change every year (next refresh: Rev. Proc. for 2027, usually published in October). Estimate only, not tax advice.
Worked examples
| Example | Input | Result |
|---|---|---|
| Long-term stock sale | Sale proceeds: 25000; Purchase price (cost basis): 12000; Acquisition fees: 10; Selling fees: 10; Days held: 730; Filing status (federal): single; Other income before this sale ($): 60000 | Adjusted cost basis: 12,010; Net proceeds: 24,990; Capital gain: 12,980; Holding period: Long-term; Gain taxed at 0%: 5,550; Gain taxed at 15%: 7,430; Gain taxed at 20%: 0; Federal capital gains tax: 1,114.50; Net investment income tax (3.8%): 0; Estimated tax: 1,114.50; After-tax net: 23,875.50 |
| Short-term crypto trade | Sale proceeds: 8000; Purchase price (cost basis): 5000; Acquisition fees: 25; Selling fees: 25; Days held: 90; Filing status (federal): mfj; Other income before this sale ($): 60000 | Adjusted cost basis: 5,025; Net proceeds: 7,975; Capital gain: 2,950; Holding period: Short-term; Taxed as ordinary income: 2,950; Federal capital gains tax: 354; Net investment income tax (3.8%): 0; Estimated tax: 354; After-tax net: 7,621 |
| Sale at a loss | Sale proceeds: 4000; Purchase price (cost basis): 6000; Acquisition fees: 0; Selling fees: 0; Days held: 200; Filing status (federal): single; Other income before this sale ($): 60000 | Adjusted cost basis: 6,000; Net proceeds: 4,000; Capital gain: -2,000; Holding period: Short-term; Federal capital gains tax: 0; Net investment income tax (3.8%): 0; Estimated tax: 0; After-tax net: 4,000 |
| Real estate flip | Sale proceeds: 350000; Purchase price (cost basis): 250000; Acquisition fees: 5000; Selling fees: 18000; Days held: 180; Filing status (federal): single; Other income before this sale ($): 60000 | Adjusted cost basis: 255,000; Net proceeds: 332,000; Capital gain: 77,000; Holding period: Short-term; Taxed as ordinary income: 77,000; Federal capital gains tax: 16,594; Net investment income tax (3.8%): 0; Estimated tax: 16,594; After-tax net: 315,406 |
FAQ
Which tax year does this use?
Tax year 2026, the returns filed in 2027, using IRS Rev. Proc. 2025-32. If you are selling in a different year the thresholds will differ slightly.
What is the difference between short-term and long-term capital gains?
Short-term gains come from assets held one year or less and are taxed at ordinary income rates. Long-term gains come from assets held more than a year and are taxed at 0%, 15% or 20%.
Why is some of my gain taxed at 0%?
Long-term gains are stacked on top of your other taxable income. The part that falls below the 0% line ($49,450 single, $98,900 married filing jointly, $66,200 head of household for 2026) is not taxed federally.
Do I pay capital gains tax if I sell at a loss?
No. A loss produces no tax here, and it can offset other gains plus up to $3,000 of ordinary income per year, with the rest carried forward. This tool does not model carryovers.
Does this include state tax?
No. Most states tax gains as ordinary income. To include a state, type a flat rate (federal plus state) in the override box.
How do I find my basis if I received shares as a gift or inheritance?
Inherited assets generally take their value at the date of death. Gifted assets usually keep the giver's basis. Brokers and the estate or giver can supply the numbers.
What is the 3.8% net investment income tax?
A separate tax on the lesser of your net investment income and the amount your income exceeds $200,000 (single or head of household) or $250,000 (married filing jointly). The thresholds are fixed by law.