Capital gains tax is the federal income tax you pay on the profit from selling a capital asset for more than its adjusted basis. The profit is the capital gain, and the tax is not a single flat rate. Short-term gains follow ordinary income rates, while long-term gains use their own 0%, 15%, or 20% brackets.

What counts as a capital asset and a capital gain?

A capital asset is almost anything you own and use for personal or investment purposes, including stocks, bonds, a home, and household furnishings. The IRS formula is amount realized from the sale minus adjusted basis. A positive result is a gain; a negative result is a loss.

Adjusted basis usually starts with what you paid, then changes for improvements, depreciation, and other adjustments. For gifts and inheritances, special basis rules apply, so do not assume the original purchase price carries over unchanged. If a rental’s depreciation lowered its basis, the guide to rental property tax deductions explains the records owners need.

For example, buy stock for $10,000, sell it for $16,000, and the gain is $6,000 before selling costs and taxes. Selling costs reduce the amount realized, so the taxable gain is usually smaller than the difference between the sticker price and the sale price. Keep the purchase confirmation and sale confirmation because those numbers support the basis and proceeds on your return.

How does the holding period change the tax rate?

The holding period decides whether a gain is short-term or long-term. Hold the asset for more than one year and the gain is long-term; hold it for one year or less and it is short-term. Count from the day after you acquire the asset through the day you sell it.

Long-term gains use the 0%, 15%, or 20% rates. Short-term gains are added to your ordinary income and taxed at graduated rates, with the top 2026 rate at 37%. The same profit can be taxed at 15% or at 22%, 24%, or higher, depending on your other income.

The 0% and 15% ceilings are based on taxable income, not the size of the gain. For 2026, the long-term brackets look like this:

RateSingle taxable incomeMarried filing jointly taxable income
0%Up to $49,450Up to $98,900
15%$49,450–$545,500$98,900–$613,700
20%Over $545,500Over $613,700

The 20% rate applies only to the amount above the 15% ceiling. Some long-term gains do not use these three rates: collectibles have a maximum 28% rate, Section 1202 qualified small business stock has a maximum 28% rate, and unrecaptured Section 1250 gain has a maximum 25% rate.

Selling on the first anniversary of acquisition is not more than one year, so the gain remains short-term. Selling the next day makes it long-term. That one-day difference can change the rate that applies to the entire gain.

How is the tax calculated on a sale?

Start with the sale proceeds, subtract the adjusted basis, then classify the gain by holding period. The final rate depends on your taxable income because long-term gains stack on top of ordinary income.

Step 1: Figure the amount realized

Amount realized is generally the cash you receive plus the fair market value of any property you receive, minus selling costs such as commissions. For a stock sale, the 1099-B proceeds are a starting point, but check them against your trade confirmations.

Step 2: Find adjusted basis

Adjusted basis starts with cost and is increased by improvements and decreased by depreciation or casualty losses. Keep receipts for improvements; basis records are what support the number on your return.

Step 3: Subtract basis and set the holding period

Gain equals amount realized minus adjusted basis. The holding period starts the day after acquisition and ends on the sale date; more than one year is long-term.

Step 4: Apply the rate and add NIIT if it applies

Long-term gains fill the 0% bracket first, then 15%, then 20%, based on taxable income. Short-term gains are ordinary income. Add the 3.8% NIIT if your modified adjusted gross income exceeds the threshold.

Worked example: a $30,000 stock gain

Suppose a single filer has $40,000 of ordinary taxable income in 2026 and sells stock held three years for a $30,000 gain. The 0% ceiling for single filers is $49,450, so $9,450 of the gain fills the 0% bracket. The remaining $20,550 is taxed at 15%: $20,550 × 0.15 = $3,082.50.

If the same $30,000 were short-term, it would be ordinary income. From $40,000, $10,400 fills the 12% bracket up to $50,400, and $19,600 falls in the 22% bracket: $10,400 × 0.12 = $1,248; $19,600 × 0.22 = $4,312; total $5,560. That is $2,477.50 more than the long-term tax in this example.

Neither example triggers the 3.8% NIIT because modified adjusted gross income stays below $200,000. A larger gain or more investment income could change that.

When does the 3.8% net investment income tax apply?

The 3.8% net investment income tax applies to the lesser of your net investment income or the amount your modified adjusted gross income exceeds the threshold. The thresholds are $250,000 for married filing jointly, $200,000 for single or head of household, and $125,000 for married filing separately.

Net investment income includes capital gains, interest, dividends, rental and royalty income, and non-qualified annuities. Wages, unemployment compensation, Social Security benefits, alimony, and most self-employment income are generally outside it. The 0.9% Additional Medicare Tax applies to wages and self-employment income, not net investment income, so it is a separate calculation.

How do capital losses reduce the tax?

Capital losses offset capital gains, and the net result can lower your tax. If losses exceed gains, you can deduct up to $3,000 of net capital loss against ordinary income, or $1,500 if married filing separately. Any excess carries forward to later years.

Losses on personal-use property, such as a home or car, generally cannot be deducted. The offset works first against gains of the same holding period, then across categories. In the end, net capital gain is net long-term capital gain minus net short-term capital loss, and that number gets the long-term rates.

What records and forms do you need?

Most sales of stocks, mutual funds, and other securities are reported to you and the IRS on Form 1099-B, and you report them on Form 8949 and Schedule D. You need the acquisition date, sale date, proceeds, and adjusted basis for each sale. Check the 1099-B against your own records; cost basis reporting can be wrong for older shares, gifts, or corporate actions.

A taxable capital gain may require estimated tax payments. A large sale late in the year can create a separate payment issue even if you expect a refund after filing. Adjust withholding or make an estimated payment by the due date to avoid an underpayment penalty.

Common mistakes

  • Treating the full sale price as taxable gain. Only the amount above adjusted basis is gain.
  • Miscounting the holding period. The one-year clock starts the day after acquisition, not on January 1.
  • Using only the purchase price as basis for gifted or inherited assets. Special basis rules can change the number.
  • Assuming every long-term gain gets 0%, 15%, or 20%. Collectibles and some business stock can face a 28% maximum, and unrecaptured Section 1250 gain a 25% maximum.
  • Forgetting the 3.8% NIIT. It sits on top of the capital gains rate and uses MAGI thresholds.
  • Deducting a loss on personal property. A loss on a home or car used for personal purposes generally is not deductible.
  • Missing Form 8949 or Schedule D reporting. Even a small sale may need to be reported.