Home›Money›How Is Capital Gains Tax Calculated? Rates Explained

How Is Capital Gains Tax Calculated? Rates Explained

A capital gain is taxed on the profit, not the proceeds, and for long-term gains the rate depends on where the gain sits in the income stack. For 2026 the 0% rate covers taxable income up to $49,450 single and $98,900 joint, the 15% rate runs to $545,500 single and $613,700 joint, and gains above that pay 20%. This guide works the calculation step by step, with the stacking rule and two worked examples.

14 min readUpdated October 2026Capital Gains Tax Calculator

Capital gains tax is charged on the profit from selling an asset, not on the whole sale price, and the rate on a long-term gain depends on the taxpayer total taxable income, not on the size of the gain alone. For 2026, the long-term rates are 0%, 15%, and 20%, and the thresholds are $49,450 and $545,500 of taxable income for single filers, and $98,900 and $613,700 for married couples filing jointly. This guide explains the calculation in order: the gain, the holding period, the stacking rule that puts the gain on top of other income, and the rate that applies to each slice, with two worked examples and the special rates for collectibles, depreciation recapture, and the net investment income tax.

Key takeaways
  • The gain is the sale price minus the basis, minus selling costs. Only the profit is taxed, and a sale at a loss produces a capital loss, not a gain.
  • Long-term gains, on assets held more than one year, are taxed at 0%, 15%, or 20% for 2026, with thresholds of $49,450 and $545,500 single, $98,900 and $613,700 joint, $66,200 and $579,600 head of household.
  • The gain stacks on top of other income, so the 0% and 15% brackets are filled by ordinary income first, and only the part of the gain that sits above a threshold pays the higher rate.
  • Collectibles are taxed at up to 28% and unrecaptured Section 1250 gain from depreciated real estate at up to 25%. Short-term gains are taxed as ordinary income, and a 3.8% net investment income tax can apply on top at higher incomes.

Step one: the gain itself

Every capital gains calculation starts with the same subtraction: amount realised minus adjusted basis equals gain or loss. The amount realised is what the seller receives, the sale price minus selling costs such as brokerage commissions and, for property, closing costs that are properly selling expenses. The adjusted basis is generally what was paid for the asset, plus the cost of improvements that add value or prolong life, minus depreciation claimed or claimable and minus any returns of capital. A share bought for $10,000 and sold for $14,000 with $50 of commission produces a gain of $3,950, not $4,000, and a house bought for $300,000, improved by $40,000 of qualifying additions, and sold for $450,000 with $20,000 of selling costs produces a gain of $90,000, not $150,000. Basis records are therefore the foundation of the calculation, and a missing basis record is the commonest cause of an overstated gain, because the IRS treats an unsubstantiated basis as zero in the worst case and the taxpayer bears the burden of proving what was paid.

Basis is not always the purchase price. Property received as a gift generally takes the donor basis, the carryover basis, so the recipient inherits the donor unrealised gain along with the asset. Property inherited at death generally receives a stepped-up basis to the fair market value at the date of death, or the alternate valuation date, which wipes out the decedent unrealised gain for income tax purposes. Property received in a like-kind exchange or a divorce transfer takes a basis determined by the exchange or transfer rules, and reinvested dividends and capital gain distributions add to the basis of mutual fund shares. Each of these rules changes the subtraction, and none of them changes the rate structure: once the gain is computed, the same thresholds and stacking apply. Keep the purchase confirmations, improvement receipts, gift and estate documents, and dividend reinvestment records, because the gain cannot be computed without them, and the calculator on this page asks for basis and proceeds precisely because the difference between them is the taxable amount.

Not every receipt is a sale for capital gains purposes. A gift is not a sale, a transfer to a spouse incident to divorce is generally not a taxable sale, and a like-kind exchange of real property defers the gain rather than taxing it, as the real estate guide explains. A sale of a personal-use asset, such as a car sold for less than was paid, produces a nondeductible personal loss, not a capital loss that offsets gains, while a personal-use asset sold for more than was paid produces a taxable gain. The character of the asset, investment, business, or personal use, decides whether the loss is usable, and the holding period decides the rate, and both questions are asked before any rate is applied. The calculator models the sale of investment and business assets; personal-use losses need separate treatment and should not be entered as offsetting losses.

Step two: the holding period

The holding period decides whether the gain is short-term or long-term, and the boundary is one year. An asset held for one year or less produces a short-term gain, taxed as ordinary income at the ordinary brackets. An asset held for more than one year produces a long-term gain, taxed at the preferential 0%, 15%, and 20% rates. The count starts the day after acquisition and includes the date of disposition: an asset bought on 1 January 2025 and sold on 1 January 2026 has been held exactly one year and the gain is short-term, while the same asset sold on 2 January 2026 has been held more than one year and the gain is long-term. One day at the boundary changes the rate on the whole gain, which is why the acquisition and sale dates should be checked before a sale near the anniversary, and why the companion long-term versus short-term guide works the boundary in detail.

The holding period can be tacked on from a prior owner in some cases, notably gifted property, where the recipient holding period generally includes the donor, and inherited property, which is generally treated as long-term regardless of how long the decedent or the heir held it. Property acquired in a like-kind exchange or a tax-free reorganisation can also carry a tacked holding period. The holding period is suspended during periods when the taxpayer has hedged the position in ways that eliminate the risk of loss, under the straddle and constructive sale rules, and short sales and options have their own holding-period rules. For the ordinary investor selling shares, funds, or property bought outright and held unhedged, the rule is simply the calendar: more than one year is long-term, one year or less is short-term, and the dates on the trade confirmation decide it.

The 2026 rate thresholds

The long-term rates for 2026, announced in IRS Revenue Procedure 2025-32, are 0% on taxable income up to the first threshold, 15% from the first threshold to the second, and 20% above the second. The thresholds are $49,450 and $545,500 for single filers, $98,900 and $613,700 for married couples filing jointly, $66,200 and $579,600 for heads of household, and $49,450 and $306,850 for married couples filing separately. The thresholds apply to taxable income, income after deductions, not to gross income or to the gain alone, which is why the stacking rule matters: ordinary income fills the brackets first. The 2026 thresholds are higher than the 2025 thresholds, which were $48,350 and $533,400 for single filers, because the thresholds are indexed for inflation, and a calculation for a 2025 sale must use the 2025 figures, not the 2026 ones. The hub calculator asks for the tax year so the right thresholds are applied.

Filing status, 20260% up to15% up to20% 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
Married filing separately$49,450$306,850$306,850

The thresholds are sometimes quoted as if they applied to the gain itself, which is wrong and overstates the 0% space for anyone with other income. A single filer with $40,000 of taxable income before any gain has only $9,450 of 0% space left, because $40,000 of the $49,450 threshold is already used by ordinary income, and the first $9,450 of the gain is taxed at 0% while the rest is taxed at 15%. A single filer with $60,000 of taxable income before the gain has no 0% space left at all, and the entire gain starts at 15%. The 0% rate is therefore most valuable to taxpayers with low taxable income in the sale year, including retirees with little other income and investors in a low-income year, and it is the reason timing a sale into a low-income year can eliminate the federal tax on a moderate gain entirely, subject to the net investment income tax and state tax, which have their own thresholds and no 0% bracket.

Step three: stacking the gain on top of income

Stacking is the rule that ordinary income is taxed first, at the ordinary brackets, and the long-term gain is placed on top, filling the preferential brackets from the bottom up. The ordinary income determines where the gain starts in the preferential brackets, and the gain then fills the 0%, 15%, and 20% bands in turn, with each slice taxed at its own rate. A gain that crosses a threshold is split: the part below the threshold at the lower rate, the part above at the higher rate, and the average rate on the gain is the blend. The tax on the gain is the sum of the slices, and the tax on the whole return is the ordinary tax on the ordinary income plus the preferential tax on the gain, computed through the qualified dividends and capital gain worksheet or the Schedule D worksheet, which performs the stacking arithmetic. The calculator on this page performs the same stacking, and the examples below show it by hand.

Stacking also explains why two taxpayers with the same gain pay different tax: the gain is the same size, but it sits at a different height in the stack. A gain of $30,000 on top of $20,000 of taxable income falls mostly in the 0% band and partly in the 15% band for a single filer, while the same gain on top of $200,000 of taxable income falls entirely in the 15% band, and on top of $600,000 it falls in the 20% band. The gain does not push the ordinary income into higher brackets, because the ordinary income is taxed first and its brackets are unaffected by the gain, but the gain can push the taxpayer over the net investment income tax threshold and over the thresholds for other income-based provisions, such as the Medicare premium surcharges, which are the indirect costs of a large gain that the stacking calculation alone does not show. Plan a large sale with the whole return in view, not with the gain in isolation.

Worked examples: a $30,000 gain and a $60,000 gain

Example one: a single filer with $40,000 of taxable income before the gain, and a $30,000 long-term gain, for 2026. Total taxable income is $70,000. The 0% threshold is $49,450, of which $40,000 is already used by ordinary income, leaving $9,450 of 0% space. The first $9,450 of the gain is taxed at 0%, which is $0, and the remaining $20,550 is taxed at 15%, which is $3,082.50. The federal tax on the gain is $3,082.50, an average rate of 10.275% on the gain, and the ordinary income is taxed separately at the ordinary brackets. If the same taxpayer had no other income, the whole $30,000 would fall under the $49,450 threshold and the federal tax on the gain would be $0, which is the 0% bracket working as designed for a low-income year. If the taxpayer instead had $60,000 of taxable income before the gain, the whole gain would start above the threshold and the tax would be $30,000 times 15%, which is $4,500.

Example two: a single filer with $520,000 of taxable income before the gain, and a $60,000 long-term gain, for 2026. Total taxable income is $580,000. The 15% threshold is $545,500, of which $520,000 is already used, leaving $25,500 of 15% space. The first $25,500 of the gain is taxed at 15%, which is $3,825, and the remaining $34,500 is taxed at 20%, which is $6,900. The federal tax on the gain is $10,725, an average rate of 17.875% on the gain, and the marginal rate on the last dollar is 20%. The net investment income tax, covered below, may add 3.8% on some or all of the gain for a taxpayer at this income, and state tax is separate. The example shows the split-bracket mechanics that the worksheet performs: no single rate applies to the whole gain, and the correct answer is always the sum of the slices.

A short-term comparison completes the picture. The $30,000 gain in example one, if it were short-term, would be taxed as ordinary income on top of $40,000 of taxable income, at the 2026 ordinary brackets, which for a single filer run 10% to $12,400, 12% to $50,400, and 22% to $105,700. The $30,000 would span the 12% and 22% brackets, costing roughly $5,000 to $6,000 depending on the exact position, against $3,082.50 as a long-term gain, a saving of roughly $2,000 to $3,000 from the holding period alone. The saving grows with income, because the ordinary brackets rise to 37% while the long-term rates stop at 20%, and it is the largest single planning lever in the capital gains system: holding an asset past the one-year mark, where the investment case allows it, is worth more than any other timing choice for most taxpayers.

Special rates: collectibles, depreciation, and the NIIT

Not all long-term gains pay 0%, 15%, or 20%. Gain on collectibles, including art, antiques, coins, stamps, and precious metals held as collectibles, is taxed at a maximum rate of 28%, rather than 20%, while still benefiting from the 0% and 15% bands at lower incomes: the 28% rate is a cap on the top slice, not a flat rate on the whole gain. Unrecaptured Section 1250 gain, the part of a gain on depreciated real estate attributable to straight-line depreciation, is taxed at a maximum rate of 25%. Both special rates are applied through the same stacking worksheet, with the special-rate gain occupying its own band in the stack, and both are federal rules with no counterpart in the preferential thresholds themselves. The real estate guide works the 25% recapture rule with a property example, and the collectibles rule matters most to investors in art, coins, and precious metals, who should not assume the 20% top rate applies to their gains.

The net investment income tax, the NIIT, adds 3.8% on the lesser of net investment income or the excess of modified adjusted gross income over a threshold: $200,000 for single filers and heads of household, $250,000 for married couples filing jointly, and $125,000 for married couples filing separately. The thresholds are not indexed for inflation, so more taxpayers cross them each year. Capital gains are net investment income, so a gain that pushes modified adjusted gross income over the threshold can attract the 3.8% tax on some or all of the gain, on top of the 0%, 15%, or 20% rate, making the top combined federal rate on a long-term gain 23.8% before state tax, and the top rate on a collectibles gain 31.8%. The NIIT is computed on Form 8962’s companion, Form 8960, and the calculator notes its possible application without computing it, since it depends on the composition of income, not only on the gain. A taxpayer near the threshold should model the NIIT before selling, because it can add thousands to the bill on a gain that the preferential rates alone priced cheaply.

Losses and netting

Gains and losses are netted before any rate is applied. Short-term losses offset short-term gains, long-term losses offset long-term gains, and a net loss in one category offsets a net gain in the other, so the taxpayer reports a single net short-term figure and a single net long-term figure, and the rates apply to the net results. A net capital loss of up to $3,000 per year, or $1,500 for married couples filing separately, can offset ordinary income, and the excess carries forward indefinitely, retaining its short-term or long-term character, to offset future gains. The carryforward does not expire, and it should be tracked year to year on the Schedule D worksheet, since a forgotten carryforward is a lost deduction. The wash-sale rule disallows a loss on a security sold and repurchased within 30 days before or after the sale, including through an IRA or a spouse’s account, and the disallowed loss is added to the basis of the replacement shares, deferring it rather than eliminating it.

Loss harvesting, realising losses in the same year as gains, shelters the gain dollar for dollar at the marginal rate the gain would have borne, which makes it most valuable against short-term gains taxed at ordinary rates and against long-term gains at 20% plus the NIIT. Harvesting should be done deliberately, with the wash-sale window respected, and with attention to the character of the loss: a long-term loss used against a short-term gain wastes the rate advantage, since the short-term gain would have been taxed higher, while a short-term loss used against a long-term gain is the efficient pairing. The netting order performs the pairing automatically in the sense that losses offset gains in their own category first, and the taxpayer’s control is over which losses to realise and when. Harvest in the year of the gain, respect the 30-day window, and keep the trade records that show the acquisition and sale dates.

Filing, estimates, and state tax

Capital gains are reported on Form 8949, which lists each sale with its dates, proceeds, basis, and adjustments, and the totals flow to Schedule D and then to the return, where the qualified dividends and capital gain worksheet computes the tax. Brokers report proceeds on Form 1099-B, and for covered securities they also report basis, but the taxpayer remains responsible for the basis where the broker does not report it, notably for older shares, gifted shares, and property. A large gain realised during the year creates an estimated-tax obligation, since no withholding applies to sale proceeds, and the safe harbours, based on the prior year’s tax or the current year’s liability, should be checked before the year ends, because the underpayment penalty applies quarter by quarter. State tax is separate and varies: some states tax capital gains at the same rates as other income, some offer their own preferences or exclusions, and some have no income tax at all, so the state bill must be computed under the state rules for the state of residence and, for real property, the state where the property sits.

The calculation in this guide is the federal calculation, and the hub calculator models it for the tax year selected, with the holding period, the thresholds, and the stacking. Verify the year’s thresholds from the IRS revenue procedure for that year, since the figures are indexed annually and a guide’s figures go stale each January. Confirm the basis from the records, confirm the holding period from the dates, and confirm the netting from the full year’s sales and losses before filing, because the rate arithmetic is straightforward and the inputs are where errors hide. A gain priced correctly, timed into the right year, and netted against the year’s losses is the cheapest lawful gain available, and the difference between that and a gain computed hastily is measured in thousands.

Frequently asked questions

How is capital gains tax calculated?

Subtract the adjusted basis and selling costs from the sale price to find the gain, determine whether it is short-term or long-term from the holding period, stack it on top of other taxable income, and apply the 0%, 15%, or 20% long-term rates to each slice.

What are the 2026 capital gains tax thresholds?

For 2026, the 0% rate covers taxable income up to $49,450 single and $98,900 joint, the 15% rate runs to $545,500 single and $613,700 joint, and gains above that pay 20%. Head of household thresholds are $66,200 and $579,600.

Is capital gains tax paid on the whole sale price?

No, only on the profit: the sale price minus the adjusted basis minus selling costs. A $14,000 sale of shares bought for $10,000 produces a gain of about $4,000, not $14,000, before commission adjustments.

What is the 3.8% net investment income tax?

A 3.8% tax on the lesser of net investment income or modified adjusted gross income above $200,000 single, $250,000 joint, or $125,000 separate. It applies on top of the capital gains rates and is not indexed for inflation.

How much capital loss can offset ordinary income?

Up to $3,000 per year, or $1,500 for married couples filing separately, with the excess carried forward indefinitely. Losses offset gains without limit in the netting process before the $3,000 limit applies.

Are collectibles taxed at a different capital gains rate?

Yes. Long-term gain on collectibles, including art, antiques, and coins, is taxed at up to 28% rather than 20%. Unrecaptured Section 1250 gain on depreciated real estate is taxed at up to 25%.

Try it on the calculator

Enter your sale in the calculator, with the holding period and tax year, and read the federal tax on the gain with the stacking shown.

Open the Capital Gains Tax Calculator →
Related guides

Similar Posts