How to Calculate Capital Gains Tax
Capital gains tax is figured on the gain, the amount realized from a sale minus the asset's adjusted basis: per IRS Topic no. 409, net short-term capital gains are taxed as ordinary income at graduated rates, while net capital gain is taxed at 0%, 15% or 20% depending on taxable income, except some gains taxed at up to 25% or 28%. For 2026, Revenue Procedure 2025-32 sets the maximum zero rate amount at $49,450 for single filers and for married individuals filing separately.
By FiftyCalc · Updated October 29, 2026, first published October 28, 2026
Open the Capital Gains Tax Calculator
How it is calculated
Gain or loss: when you sell a capital asset, the difference between the adjusted basis in the asset and the amount you realized from the sale is a capital gain or a capital loss, and an asset's basis is generally its cost to the owner, but for an asset received as a gift or inheritance the IRS refers to Publication 551, Basis of Assets. Held for more than one year, the gain or loss is generally long-term; held one year or less, it is short-term. Losses from the sale of personal-use property, such as a home or a car, aren't tax deductible.
Net capital gain: the amount by which net long-term capital gain for the year is more than net short-term capital loss for the year. Net short-term capital gains are taxed as ordinary income at graduated tax rates.
Rate thresholds: Topic no. 409 explains, with the 2025 amounts, that the 0% rate applies if taxable income is less than or equal to a first threshold, the 15% rate if it is more than that threshold but less than or equal to a second threshold, and 20% to the extent taxable income exceeds the thresholds set for the 15% rate, so that, on the worksheet below, different parts of a gain can be taxed at different rates. For taxable years beginning in 2026, Revenue Procedure 2025-32 sets the maximum zero rate amount at $49,450 for single filers and married individuals filing separately, $66,200 for heads of household and $98,900 for married couples filing jointly. The maximum 15 percent rate amount is $545,500 for single filers, $306,850 for married filing separately, $579,600 for heads of household and $613,700 for married filing jointly.
Exceptions and losses: the taxable part of a gain from section 1202 qualified small business stock and net gains from collectibles are taxed at a maximum 28% rate, and unrecaptured section 1250 gain at a maximum 25% rate. When capital losses exceed capital gains, the excess loss that can lower income is the lesser of $3,000 ($1,500 if married filing separately) or the total net loss shown on line 16 of Schedule D, and a net capital loss above this limit can be carried forward to later years. The calculator offers the single, married filing jointly and head of household statuses, not married filing separately, so it applies the $3,000 limit: for a single filer with $80,000 of other income, a $10,000 long-term loss, a $2,000 short-term gain, the $16,100 standard deduction for 2026 and no itemized deductions, the net loss of $10,000 − $2,000 = $8,000 is limited to $3,000, and taxable income is $80,000 − $3,000 − $16,100 = $60,900. Order of the rates: on the IRS Qualified Dividends and Capital Gain Tax Worksheet (Form 1040 instructions, 2025), for a filer who doesn't file Form 2555 (foreign earned income), line 1 is taxable income (Form 1040, line 15), line 2 the qualified dividends (line 3a) and line 3, if you file Schedule D, the smaller of line 15 or line 16 of Schedule D (-0- if either is blank or a loss), and if you don't, the amount of Form 1040, line 7a (capital gain or loss); line 6 is the 0% threshold, and line 5, taxable income minus lines 2 and 3 (-0- if zero or less), fills that threshold first, so that only what is left of it (line 9) is taxed at 0%. For the cases it covers (no 28% rate gain or unrecaptured section 1250 gain, and no Form 2555), the calculator follows the same order with the 2026 amounts in place of those of the 2025 worksheet: with $20,000 of other income, a $20,000 long-term gain and the $16,100 standard deduction for a single filer in 2026, taxable income is $23,900, of which $3,900 is ordinary income (worksheet line 5), and since ordinary income and gain together, $3,900 + $20,000 = $23,900, stay below the $49,450 maximum zero rate amount for 2026, line 9 leaves the whole gain taxed at 0%.
Worked example
Line 22 of the worksheet figures the tax on the amount on line 5 with the Tax Table if that amount is less than $100,000 (the Tax Computation Worksheet otherwise); the calculator applies the 2026 rate schedules directly, so the tax on a return can differ by a few dollars. Assumptions: the 2026 tax year, filing status single, $60,000 of other income after adjustments (no gains in it), a $20,000 net long-term capital gain on an asset generally treated as long-term because it was held more than one year, outside the 25% and 28% exceptions, no short-term gain or loss, no qualified dividends, no itemized or other deductions besides the $16,100 standard deduction, no credits and no other federal taxes. Taxable income is $60,000 + $20,000 − $16,100 = $63,900:
| Filing status | Single |
|---|---|
| Other income for 2026, after adjustments, without the gains, losses and qualified dividends below | $60,000 |
| Net long-term capital gain or loss, assets held more than 1 year (a loss is negative) | $20,000 |
| Net short-term capital gain or loss, assets held 1 year or less (a loss is negative) | $0 |
| Qualified dividends | $0 |
| Itemized deductions, if you itemize | $0 |
| Taxable income | $63,900 |
|---|---|
| Gains and qualified dividends taxed at 0% | $5,550 |
| Gains and qualified dividends taxed at 15% | $14,450 |
| Gains and qualified dividends taxed at 20% | $0 |
| Tax on the rest of your taxable income at the regular rates | $5,020 |
| Federal income tax | $7,188 |
| Tax added by your capital gains, losses and qualified dividends | $2,168 |
Figures computed by this site's calculator from the inputs above. Run your own numbers: Capital Gains Tax Calculator
Frequently asked questions
Why is part of the gain taxed at 0% in the example?
As on line 5 of the worksheet, $63,900 − $20,000 = $43,900 of the taxable income is ordinary income. The 2026 maximum zero rate amount for a single filer is $49,450, so $49,450 − $43,900 = $5,550 of the gain is taxed at 0% and the other $20,000 − $5,550 = $14,450 at 15%. The ordinary income is taxed with the 2026 table for unmarried individuals: 10% of the first $12,400 plus 12% of the next $43,900 − $12,400 = $31,500, that is $1,240 + $3,780 = $5,020. The tax is $5,020 on the ordinary income, nothing on the first $5,550 of the gain taxed at 0% up to the $49,450 threshold, plus 15% × $14,450 = $2,167.50, or $7,187.50, shown rounded as $7,188.
Does the calculator include the net investment income tax?
No: the IRS describes a 3.8 percent net investment income tax (NIIT) on individuals with net investment income above threshold amounts, and the calculator figures only federal income tax on taxable income, ordinary income and gain included, without the NIIT or state taxes.
What makes a gain long-term?
Generally, holding the asset for more than one year before disposing of it. To count, the IRS generally starts from the day after the day the asset was acquired, up to and including the day it was disposed of.
Sources
- Topic no. 409, Capital gains and losses IRS page dated 2026-09-24, checked on 2026-10-28
- Instructions for Form 1040 (2025), Qualified Dividends and Capital Gain Tax Worksheet, line 16 IRS checked on 2026-10-29
- Topic no. 559, Net investment income tax IRS page dated 2026-09-24, checked on 2026-10-29
- Form 1040 (2025), U.S. Individual Income Tax Return, lines 3a, 7a and 15 IRS checked on 2026-10-29
- Revenue Procedure 2025-32, sections 4.01 (tax rate tables), 4.03 (maximum capital gains rate) and 4.14 (standard deduction), 2026 IRS checked on 2026-10-28
General information drawn from the official sources above, not tax or legal advice. Amounts change from year to year: check the source for your tax year.