Skip to main content

HomeAll guides

What the Capital Gains Tax Rate Is and How It's Calculated

The federal capital gains tax rate depends on your income and how long you held the asset

The long-term capital gains tax rate is 0%, 15%, or 20%, depending on your total taxable income for the year. These are the rates that explore when you sell an asset you've owned for more than one year. The IRS sets income thresholds each year, and they change annually based on inflation.

For 2024, the 0% rate applies if your taxable income falls below $47,025 (single filers) or $94,050 (married filing jointly). The 15% rate applies to income between those amounts and $518,900 (single) or $583,750 (married filing jointly). Anything above that is taxed at 20%. These thresholds shift each year, so the numbers you use depend on the year you sold the asset.

Short-term capital gains — from assets held one year or less — are taxed as ordinary income at your regular tax bracket rate, which can be as high as 37% federally. This is a significant difference, which is why the holding period matters so much.

Key Takeaways

  • Long-term capital gains rates are 0%, 15%, or 20% based on your total taxable income that year, while short-term gains are taxed at your ordinary income rate.
  • The income thresholds that determine which rate applies change every year and vary by filing status, so you must check the current year's brackets.
  • Your state may also tax capital gains, and some states have their own rates separate from the federal tax.
  • The calculation starts with the sale price minus what you paid for the asset, and you report this on Schedule D of your tax return.

How the IRS calculates your capital gain or loss

The basic math is straightforward: sale price minus your cost basis equals your gain. Your cost basis is usually what you paid for the asset, including any fees or commissions. If you bought 100 shares of stock at $50 per share and paid a $10 commission, your basis is $5,010 total, or $50.10 per share.

When you sell those 100 shares for $7,000, your gain is $7,000 minus $5,010, which equals $1,990. That $1,990 is what gets taxed, not the full $7,000 sale price. If the sale price had been $4,500 instead, you would have a $490 loss, which you can use to offset other gains or, in some cases, reduce your ordinary income.

Basis can be more complex with inherited assets, stock splits, or reinvested dividends. The IRS allows you to use different methods to identify which shares you're selling — for example, first-in-first-out (FIFO) or specific identification — and the method you choose affects your gain or loss. Most brokers track this for you and report it on Form 1099-B.

State capital gains taxes vary widely

Most states do not have a separate capital gains tax, but some do. Washington, Illinois, and a few others have enacted capital gains taxes in recent years, though the rates and rules differ. Some states tax capital gains as part of ordinary income at their regular income tax rate, which can range from 0% to over 13% depending on the state and your income level.

A few states — including Florida, Texas, and Wyoming — have no income tax at all, so there is no state capital gains tax. If you live in one of these states, you only owe federal tax on your gains. If you moved during the year you sold the asset, you may owe tax to both your old state and your new state, depending on when the sale occurred and each state's rules.

Your broker's 1099-B form reports only federal information. You will need to check your state's tax authority website or speak with a tax preparer to understand what you owe at the state level.

How to report capital gains on your tax return

You report capital gains and losses on Schedule D, which is part of Form 1040. Schedule D has two sections: one for long-term gains and losses (assets held more than one year) and one for short-term gains and losses (assets held one year or less). You list each transaction separately — the asset name, the date acquired, the date sold, the cost basis, the sale price, and the gain or loss.

Your broker sends you Form 1099-B after the year ends, which shows the sales you made and often includes basis information. You use this form to fill out Schedule D. If your 1099-B shows incorrect basis, you can correct it on your return with an explanation.

After you complete Schedule D, the totals carry to Form 1040. Long-term gains go to a specific line, and short-term gains are added to your ordinary income. Tax software usually walks you through this step by step, asking you to enter each sale and calculating the gain automatically.

What happens if you have losses

Capital losses can reduce your capital gains dollar-for-dollar. If you had $5,000 in long-term gains and $2,000 in long-term losses, your net long-term gain is $3,000, and that is what gets taxed. You can also use losses to offset short-term gains.

If your losses exceed your gains in a year, you can deduct up to $3,000 of the excess loss against your ordinary income (wages, salary, interest, and so on). Any loss above $3,000 carries forward to the next year, where you can use it again. This carryforward continues indefinitely until the loss is fully used.

Tracking losses is important because they reduce your tax bill. Many people sell losing positions late in the year specifically to offset gains and lower their tax liability — a practice called tax-loss harvesting. You must be careful not to buy the same or a substantially identical security within 30 days before or after the sale, or the IRS will disallow the loss under the wash-sale rule.

Special situations that affect your rate

Certain types of gains are taxed differently. Collectibles — artwork, coins, stamps, and similar items — are taxed at a maximum of 28%, even if you would normally may have access to for the 15% or 20% rate. Section 1202 gains from may have access to small business stock held more than five years may be partially or fully excluded from tax, depending on when you bought the stock.

If you are subject to the Net Investment Income Tax (NIIT), an additional 3.8% tax applies to your capital gains if your modified adjusted gross income exceeds $200,000 (single) or $250,000 (married filing jointly). This tax was enacted as part of the Affordable Care Act and applies to high-income earners.

Gains on the sale of your primary residence may be excluded entirely if you meet the ownership and use tests — up to $250,000 for single filers or $500,000 for married couples filing jointly. This exclusion is available once every two years and does not require you to itemize deductions.

How income level determines which rate applies to you

Your capital gains rate is determined by where your total taxable income falls within the year's brackets, not by the size of the gain itself. If you are single and your taxable income (wages, interest, dividends, and other income combined) is $60,000, and you have a $10,000 long-term capital gain, your total taxable income becomes $70,000. The portion of that gain that falls within the 0% bracket is taxed at 0%, and the rest is taxed at 15%.

This is why some people time the sale of assets strategically. If you are close to the edge of a bracket, selling in a year when your other income is lower might keep you in a lower capital gains bracket. Conversely, if you know you will have a high-income year, you might delay a sale to the following year.

Tax software and tax preparers can model different scenarios for you — showing what your tax bill would be if you sold in December versus January, for example. This kind of planning is legal and common, especially for large gains.

Frequently Asked Questions

Is the capital gains tax rate the same every year?

The federal rates (0%, 15%, 20%) stay the same, but the income thresholds that determine which rate applies change annually. The IRS adjusts them for inflation. You must use the thresholds for the year you sold the asset, not the year you bought it.

Do I owe capital gains tax if I sell at a loss?

No, you do not owe tax on a loss. Instead, you can use the loss to reduce any capital gains you have that year, and if losses exceed gains, you can deduct up to $3,000 against ordinary income. Excess losses carry forward to future years.

What if I inherited stock — is the gain calculated from what the person paid or from what it was worth when they died?

Inherited assets receive a "step-up in basis," meaning your cost basis is the fair market value on the date of death, not what the original owner paid. If you inherit stock worth $10,000 and sell it for $10,500 a year later, your gain is only $500, not the full difference from the original purchase price.

Do I have to pay capital gains tax if I reinvest the money?

Yes. The tax is based on the gain itself, not on what you do with the proceeds. Whether you spend the money, reinvest it, or leave it in a savings account does not change the tax you owe on the sale.

How do I know if I owe the Net Investment Income Tax on top of capital gains tax?

The NIIT applies if your modified adjusted gross income exceeds $200,000 (single) or $250,000 (married filing jointly) and you have net investment income, which includes capital gains. Your tax software or preparer will calculate this automatically if you meet the income threshold.

This guide is for general information only and is not medical, financial, legal, or other professional advice. For decisions specific to your situation, consult a qualified professional. See our Editorial Policy.