The basic calculation: sale price minus what you paid, times your tax rate

Capital gains tax is calculated on the profit you make when you sell an asset — a stock, rental property, cryptocurrency, or mutual fund. The profit itself (called the gain) is what gets taxed, not the full sale price. To find your gain, subtract what you paid for the asset from what you sold it for. That number is then taxed at either a short-term rate (ordinary income rates, if you held it less than a year) or a long-term rate (lower rates, if you held it a year or more).

The math looks like this: Sale Price − Cost Basis = Capital Gain. Then multiply that gain by your applicable tax rate. If you sold a stock for $5,000 that you bought for $3,000, your gain is $2,000. The tax on that $2,000 depends on how long you held it and your income level.

The tricky part is not the multiplication — it is tracking your cost basis (what you actually paid) and knowing which rate applies. Many people underestimate their gains because they forget about reinvested dividends or lose track of purchase records.

Key Takeaways

  • Your capital gain is the sale price minus your cost basis, and only the gain is taxed, not the full proceeds.
  • Long-term gains (assets held over one year) are taxed at 0%, 15%, or 20% depending on your income; short-term gains are taxed as ordinary income.
  • Cost basis includes the purchase price plus any reinvested dividends, stock splits, and fees, so you must track all of these to calculate correctly.
  • You report capital gains on Schedule D (Form 1040) and must separate long-term and short-term gains because they are taxed differently.
  • Losses can offset gains dollar-for-dollar, and unused losses can carry forward to future years, which is why tracking all sales matters.

Long-term versus short-term: the holding period that changes your rate

How long you held the asset determines which tax rate applies. If you owned it for more than one year before selling, it is a long-term capital gain and taxed at preferential rates: 0%, 15%, or 20% depending on your taxable income. If you owned it for one year or less, it is a short-term capital gain and taxed as ordinary income — the same rate as your wages or salary.

The holding period starts the day after you buy and ends the day you sell. If you bought a stock on March 15, 2023, and sold it on March 15, 2024, you held it exactly one year, so it qualifies as long-term. If you sold it on March 14, 2024, it is short-term.

Long-term rates are significantly lower. For 2024, the 15% long-term rate applies to most middle-income filers, while short-term gains for the same person might be taxed at 22%, 24%, or higher. This difference alone makes the holding period worth planning around — sometimes waiting a few weeks to cross the one-year mark saves hundreds or thousands in tax.

Finding your cost basis: what counts as what you paid

Cost basis is not just the purchase price. It includes the purchase price plus any fees you paid to buy the asset, plus any reinvested dividends or capital distributions, plus adjustments for stock splits or mergers. If you bought 100 shares at $50 each and paid a $25 commission, your cost basis is $5,025, not $5,000.

Reinvested dividends are a common source of error. If you own a mutual fund or dividend-paying stock and chose to reinvest the dividends instead of taking them in cash, each reinvestment adds to your cost basis. Your brokerage statement should show this, but many people miss it and understate their basis, overstating their gain.

For inherited assets, cost basis is "stepped up" to the fair market value on the date of death, not the original purchase price. If your parent bought a stock for $10,000 and it was worth $50,000 when they died, your cost basis is $50,000. This is one of the few times a higher basis is good news — it means you owe less tax if you sell soon after inheriting.

Your brokerage should provide cost basis information on your 1099-B form or in your account statements. If records are missing, contact the broker or the fund company directly. The IRS can assess penalties if your basis is wrong and you cannot document it.

Separating long-term and short-term gains on your tax return

You report capital gains on Schedule D (Form 1040), and you must list long-term and short-term gains separately. The IRS taxes them differently, so mixing them up changes what you owe.

On Schedule D, Part I is for short-term gains (assets held one year or less). Part II is for long-term gains (assets held more than one year). You add up all short-term gains and losses in Part I, then all long-term gains and losses in Part II. If you have a net loss in either category, you can use it to offset gains in the other category. Any remaining loss can offset up to $3,000 of ordinary income in the current year, with unused losses carrying forward indefinitely.

If you sold only one or two assets, Schedule D is straightforward. If you traded frequently or own mutual funds, you may have dozens of transactions. Many tax software packages import transactions directly from your brokerage, which reduces errors. If you do it by hand, list each sale separately with the date acquired, date sold, proceeds, and cost basis.

Using losses to reduce what you owe

Capital losses are valuable because they offset capital gains dollar-for-dollar. If you had $8,000 in long-term gains and $3,000 in long-term losses, your net long-term gain is $5,000, and you are taxed on $5,000, not $8,000.

Losses can also offset gains in the other category. If you have $5,000 in short-term gains and $7,000 in long-term losses, the losses first eliminate the short-term gains, leaving $2,000 in unused long-term losses. That $2,000 can then offset $2,000 of ordinary income (wages, interest, etc.) in the current year.

If your losses exceed your gains and your ordinary income, you can carry the unused loss forward to future years with no time limit. A $10,000 loss in 2024 that you cannot use can be used in 2025, 2026, or whenever you have gains or income to offset. This is why tracking all sales — even the losing ones — matters.

One caveat: the wash-sale rule prevents you from claiming a loss if you buy the same or a substantially identical security within 30 days before or after the sale. If you sell a stock at a loss on December 15 and buy it back on January 10, the loss is disallowed and added to the basis of the new purchase instead. This rule applies to stocks and mutual funds but not to bonds or most other assets.

State and local taxes on capital gains

Federal capital gains tax is only part of the picture. Most states tax capital gains as ordinary income, meaning your state rate applies on top of the federal rate. A few states — including Alaska, Florida, Nevada, South Dakota, Tennessee, Texas, Washington, and Wyoming — have no income tax at all, so there is no state capital gains tax.

Some states have special rates for capital gains. California taxes them as ordinary income. New York taxes them as ordinary income. Illinois and Iowa have lower rates on capital gains than on wages. The rate varies widely, so check your state's tax authority website or ask a tax professional in your state.

If you moved during the year you sold an asset, you may owe tax to both states. The state where you lived when you sold it usually has the primary claim, but you may be able to claim a credit for taxes paid to the other state.

Special situations: real estate, collectibles, and inherited assets

Real estate gains are generally taxed like any other long-term gain, but there is an exception: if you sold your primary residence, you may be able to exclude up to $250,000 of gain (or $500,000 if married filing jointly) if you owned and lived in the home for at least two of the last five years. This exclusion applies once every two years, and it is one of the largest tax breaks available.

Collectibles — art, antiques, precious metals, and certain coins — are taxed at a maximum rate of 28% on long-term gains, not the standard 15% or 20%. This is higher than the usual long-term rate, so if you collect, you should know this going in.

Inherited assets receive a step-up in basis, meaning your cost basis is the fair market value on the date of death. If you inherit a stock worth $100,000 and sell it a month later for $102,000, you owe tax on only $2,000, not on the entire appreciation that occurred while the previous owner held it. This step-up is one reason inherited assets are often sold quickly — the tax benefit is largest when ready after death.

Frequently Asked Questions

Do I have to report capital gains if I made less than $1,000?

Yes. There is no minimum gain amount that triggers reporting. If you sold an asset at a profit, you must report it on Schedule D, even if the gain is $50. However, if your total capital gains are small and you have no other income, you may owe no tax due to the standard deduction.

What if I sold a mutual fund and don't know my cost basis?

Contact the fund company or your brokerage — they are required to maintain cost basis records. If records truly do not exist, you may be able to reconstruct basis using old statements or account confirmations. If you cannot document it, the IRS may assume your entire proceeds are gain, which is the worst outcome.

Can I deduct investment losses from my regular income?

Only up to $3,000 per year. Capital losses first offset capital gains, then up to $3,000 of ordinary income. Any loss above that carries forward to future years. So a $10,000 loss can offset $3,000 of wages this year and $3,000 next year, with $4,000 remaining to carry forward again.

If I inherited stock, do I owe capital gains tax when I inherit it?

No. Inheritance itself is not a taxable event. You owe tax only when you sell the inherited asset. Your cost basis is the fair market value on the date of death, so if the stock has appreciated since then, you owe tax on only that new appreciation.

How do I report cryptocurrency gains?

The same way as stocks: on Schedule D. Each trade or sale is a taxable event. If you bought Bitcoin for $20,000 and sold it for $45,000, you report a $25,000 gain. If you traded one cryptocurrency for another, that is also a sale and triggers tax. Keep detailed records of every transaction, including the date and fair market value in dollars at the time of the trade.