What you owe depends on your income, filing status, and how long you held the asset

Capital gains tax is calculated by multiplying your net capital gain (the profit after subtracting what you paid) by a tax rate. That rate is either 0%, 15%, or 20% for most people, or ordinary income rates (10% to 37%) if you held the asset less than a year. The rate you pay depends on your total taxable income for the year and whether you are single, married filing jointly, or head of household. Two people with the same $50,000 gain can owe different amounts because they have different incomes.

The IRS does not send you a bill for capital gains tax separately. Instead, you report the gain on your tax return (Schedule D if you use Form 1040), and it gets added to your other income. Your total tax bill then depends on everything you earned that year — wages, interest, dividends, and capital gains combined.

Key Takeaways

  • Long-term capital gains (assets held over one year) are taxed at 0%, 15%, or 20% depending on your total income and filing status; short-term gains are taxed as ordinary income.
  • Your capital gain is the sale price minus what you paid for the asset, minus any selling costs like broker fees or commissions.
  • The tax brackets for 0%, 15%, and 20% rates change each year and are different for single filers, married couples, and heads of household.
  • You report capital gains on Schedule D of your tax return, and the gain is added to your other income to determine your total tax.
  • State and local taxes on capital gains vary widely — some states have no capital gains tax, while others tax gains as ordinary income.

How to calculate your net capital gain

Start with the price you sold the asset for. Subtract the price you paid for it. That is your raw gain or loss. Then subtract any costs directly tied to the sale — broker commissions, fees paid to a financial advisor for the transaction, or transfer taxes charged by your state.

If you sold multiple assets in the same year, you calculate the gain or loss on each one separately, then add them together. If you had a $10,000 gain on one stock and a $3,000 loss on another, your net capital gain for the year is $7,000. Losses can offset gains, which is why some people sell losing positions before year-end.

Keep records of the purchase price, sale price, and date of purchase and sale for every asset. The IRS calls the purchase price your cost basis. If you inherited an asset, your cost basis is usually the value on the date the person died, not what they originally paid — this is called a "step-up in basis" and can significantly lower your tax.

Long-term versus short-term capital gains rates

How long you held the asset matters. If you owned it for more than one year before selling, it is a long-term capital gain and gets the preferential rates: 0%, 15%, or 20%. If you owned it for one year or less, it is a short-term capital gain and is taxed as ordinary income at your regular tax bracket rate, which ranges from 10% to 37%.

The holding period starts the day after you buy and ends on 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.

For most people, long-term rates are much lower. A short-term gain of $10,000 could be taxed at 24% (federal only), costing $2,400. The same $10,000 long-term gain might be taxed at 15%, costing $1,500. This is why financial advisors often suggest holding investments longer than a year when possible.

Federal tax brackets for long-term capital gains in 2024

The 0%, 15%, and 20% rates explore to different income ranges, and those ranges differ by filing status. These brackets adjust each year for inflation. The ranges below are for 2024 tax returns (filed in 2025); they will be different for 2025 returns.

Filing Status0% Rate15% Rate20% Rate
SingleUp to $47,025$47,025 to $518,900Over $518,900
Married Filing JointlyUp to $94,050$94,050 to $583,750Over $583,750
Head of HouseholdUp to $62,975$62,975 to $551,350Over $551,350

These ranges are based on your total taxable income, not just your capital gains. If you are single, earn $40,000 in wages, and have a $20,000 long-term capital gain, your total taxable income is $60,000. The first $7,025 of your gain ($47,025 minus $40,000) is taxed at 0%, and the remaining $12,975 is taxed at 15%.

How state and local taxes affect your total bill

Federal capital gains tax is only part of the picture. Most states also tax capital gains, though the rate and rules vary widely. Nine states — Alaska, Florida, Nevada, South Dakota, Tennessee, Texas, Washington, Wyoming, and New Hampshire — have no state income tax at all, so residents pay only federal capital gains tax. New Hampshire taxes only interest and dividends, not capital gains.

Other states tax capital gains as ordinary income, meaning your state rate depends on your state tax bracket. California, for example, taxes long-term capital gains at the same rate as wages — up to 13.3% at the highest bracket. A few states, including Maryland and Vermont, have separate capital gains tax rates that are lower than their ordinary income rates.

Some cities and counties also impose local income taxes that explore to capital gains. New York City, for instance, adds a local tax on top of state and federal taxes. Check your state's department of revenue website or speak with a tax professional to learn the exact rate in your location.

What happens if you have capital losses

If you sold an asset for less than you paid, you have a capital loss. You can use losses to offset gains dollar-for-dollar. If you had $15,000 in gains and $6,000 in losses, your net capital gain is $9,000, and that is what you report on your tax return.

If your losses exceed your gains in a year, you can deduct up to $3,000 of the excess loss against ordinary income (wages, interest, and other income). Any losses beyond that $3,000 carry forward to future years, where you can use them to offset future gains or ordinary income. This carryforward has no time limit — you can use losses from 2024 in 2030 if you have not used them by then.

This is why some investors practice "tax-loss harvesting" — selling losing positions late in the year to offset gains and reduce their tax bill. You can then buy a similar (but not identical) investment to stay in the market. The IRS has a "wash sale" rule that prevents you from buying the same security within 30 days before or after the sale, so timing matters.

How to report capital gains on your tax return

You report capital gains on Schedule D (Form 8949 Sales of Capital Assets), which you attach to your Form 1040. You list each sale separately: the asset name, date acquired, date sold, cost basis, sale price, and gain or loss. If you have many transactions, your brokerage will send you a summary, and you can use that to fill out the form.

Your brokerage also sends you a Form 1099-B (Proceeds from Broker and Barter Exchange Transactions) that reports the sale price and date. The IRS receives a copy, so your numbers need to match. If there is a discrepancy, the IRS will contact you.

If you use tax software like TurboTax or TaxAct, you can import transactions directly from your brokerage, which reduces the chance of errors. If you work with a tax professional, bring them your 1099-B forms and a list of cost basis for each sale.

Frequently Asked Questions

Do I owe capital gains tax if I have not sold the asset yet?

No. Capital gains tax is only owed when you sell and realize the gain. If you own a stock worth $50,000 more than you paid but have not sold it, you owe nothing. The gain is "unrealized" and is not taxed. You only owe tax when you sell and lock in the gain.

What if I inherited an asset — do I owe capital gains tax when I sell it?

Probably not, or very little. Inherited assets receive a "step-up in basis," meaning your cost basis is the value on the date the person died, not what they originally paid. If the asset was worth $100,000 when inherited and you sell it for $105,000 a year later, your gain is only $5,000, not the full amount the original owner would have owed.

Can I deduct investment losses from my paycheck?

Only up to $3,000 per year. If you had $10,000 in losses and no gains, you can deduct $3,000 against your wages and other income. The remaining $7,000 carries forward to next year. You cannot deduct more than $3,000 in any single year, but you can use losses indefinitely in future years.

Do I owe capital gains tax on my primary home when I sell it?

Usually not, if you meet the requirements. Single filers can exclude up to $250,000 of gain on a primary home; married couples filing jointly can exclude up to $500,000. You must have owned and lived in the home for at least two of the last five years. Gains beyond that threshold are taxed as long-term capital gains.

How do I know my cost basis if I lost the original purchase records?

Contact your brokerage — they keep records going back many years and can provide a cost basis statement. If the brokerage no longer has records, you may need to estimate based on historical price data or work with a tax professional. Keep all purchase confirmations and statements going forward to avoid this problem.