Skip to main content

HomeAll guides

How to Figure Out What You Owe on Investment Profits

The basic formula: what you sold minus what you paid, times your tax rate

Capital gains tax is calculated on the profit you make when you sell an investment for more than you paid for it. The profit itself — not the sale price — is what gets taxed. To find your gain, subtract what you originally paid (your cost basis) from what you sold it for (your sale price). That number is your capital gain.

The tax you owe depends on two things: how long you held the investment and your income tax bracket. If you held it for one year or less, it's a short-term capital gain and taxed as ordinary income at your regular tax rate. If you held it for more than one year, it's a long-term capital gain and taxed at a lower rate — either 0%, 15%, or 20%, depending on your income.

You report capital gains on Schedule D (Form 1040) when you file your federal tax return. The IRS requires you to report every sale, even if you made a loss, because losses can offset gains.

Key Takeaways

  • Capital gain equals sale price minus cost basis; only the gain is taxed, not the full sale price.
  • Short-term gains (held one year or less) are taxed at your ordinary income rate, which can be as high as 37%.
  • Long-term gains (held over one year) are taxed at 0%, 15%, or 20% depending on your total income for the year.
  • You must report all sales on Schedule D, including losses, because losses can reduce the gains you owe tax on.
  • Cost basis includes the purchase price plus any fees or commissions paid to buy the investment.

What counts as your cost basis

Cost basis is what you paid to acquire the investment, plus any costs directly tied to buying it. If you bought 100 shares of stock at $50 per share and paid a $10 commission, your cost basis is $5,010 (not $5,000). If you inherited stock, received it as a gift, or earned it through an employee stock plan, the cost basis rules are different — the IRS has specific rules for each situation.

When you sell only part of a holding — say, 30 of those 100 shares — you need to know which shares you're selling. If you don't specify, the IRS assumes you sold the oldest ones first (called FIFO, or first-in-first-out). You can choose a different method if you tell your broker in writing before the sale, which can lower your tax if you sell higher-cost shares instead.

Brokers now report cost basis to the IRS on Form 1099-B for most stock and fund sales. Check the basis they report against your own records; errors happen, and you're responsible for correcting them on your tax return.

Short-term versus long-term: the one-year rule

The holding period matters because the tax rate is much lower for long-term gains. You must own the investment for more than one year for it to may have access to as long-term. "More than one year" means if you bought on January 15, 2023, you can sell on January 16, 2024 and get the long-term rate. If you sell on January 15, 2024, it's short-term.

Short-term gains are taxed at your ordinary income tax rate — the same rate that applies to wages, interest, and other regular income. For 2024, that ranges from 10% to 37% depending on your income and filing status. Long-term gains are taxed at 0%, 15%, or 20%, which is significantly lower for most people.

The difference can be substantial. If you're in the 24% tax bracket and sell a stock with a $10,000 gain after holding it 11 months, you owe $2,400. If you hold it one more month and sell it, you owe $1,500 (at the 15% long-term rate). Timing a sale by a few weeks can sometimes save thousands in tax.

How long-term capital gains tax rates work

Long-term capital gains are taxed at 0%, 15%, or 20% based on your taxable income for the year, not your tax bracket. The 0% rate applies if your income is low enough; the 15% rate covers most middle-income filers; the 20% rate applies to high earners. The income thresholds change each year and depend on whether you're single, married filing jointly, or head of household.

For 2024, the 15% long-term rate applies to single filers with taxable income between roughly $47,000 and $518,000 (these numbers are approximate and adjusted annually). If your income falls below that range, you may may have access to for the 0% rate. If it's above, you pay 20%. Your broker or tax software will calculate which rate applies to you based on your total income.

You can sometimes reduce your tax by timing when you realize gains and losses. If you have a large gain one year, you might sell a losing investment to offset it. Or you might delay selling a winning investment until the next year if your income will be lower then, potentially moving you into a lower tax bracket.

Using losses to reduce what you owe

If you sell an investment for less than you paid, you have a capital loss. You can use losses to offset gains dollar-for-dollar. If you sold stocks with a $15,000 gain and bonds with a $6,000 loss in the same year, your net capital gain is $9,000, and you're taxed on only that amount.

If your losses exceed your gains in a year, you can deduct up to $3,000 of the excess loss against your ordinary income (like wages). Any loss beyond $3,000 carries forward to future years, where you can use it to offset future gains or take another $3,000 deduction against income.

This is why you must report losses on your tax return even though they don't result in a tax bill. The IRS tracks your loss carryforwards, and if you don't report a loss, you lose the ability to use it later. Keep records of every sale, gain or loss, for at least three years.

Special situations: mutual funds, dividends, and inherited investments

Mutual fund distributions complicate capital gains because funds distribute gains to shareholders even if you didn't sell. If a fund realizes gains from its own trading and distributes them to you, you owe tax on those distributions as if you had sold the fund yourself. The fund sends you a Form 1099-DIV showing short-term and long-term distributions separately.

may have access to dividends — dividends from U.S. corporations or certain foreign corporations — are taxed at the same long-term capital gains rates (0%, 15%, or 20%), not at ordinary income rates. Non-may have access to dividends are taxed as ordinary income. Your broker reports which dividends are may have access to on your 1099-DIV.

If you inherited an investment, the cost basis "steps up" to its value on the date of death, not what the original owner paid. If your parent bought stock for $5,000 and it was worth $25,000 when they died, your cost basis is $25,000. If you sell it when ready for $25,000, you owe no capital gains tax. This step-up applies to most inherited assets but not to inherited IRAs or retirement accounts.

Reporting capital gains on your tax return

You report capital gains on Schedule D (Form 1040), which has separate sections for short-term and long-term gains and losses. List each sale individually — the date you bought it, the date you sold it, the sale price, the cost basis, and the gain or loss. Your broker provides most of this information on Form 1099-B, though you may need to add cost basis if the broker didn't report it.

After you complete Schedule D, you transfer the net total to Form 1040. Short-term gains go into your ordinary income. Long-term gains go to a separate line where they're taxed at the preferential rates. Tax software walks you through this process and calculates your tax automatically once you enter the sale information.

If you have only a few straightforward sales, some tax software lets you enter them directly without printing Schedule D. But if you have many sales or complex situations — like inherited investments or wash sales — you should complete Schedule D fully to document your work.

Frequently Asked Questions

Do I have to report a capital loss if I didn't make any gains?

Yes. You report losses on Schedule D even if you have no gains. Losses offset gains, and if losses exceed gains, you can deduct up to $3,000 against your other income. Any unused loss carries forward, so you need a record of it for future years.

What is a wash sale and how does it affect capital gains?

A wash sale occurs when you sell an investment at a loss and buy the same or substantially identical investment within 30 days before or after the sale. The IRS disallows the loss, and instead adds it to the cost basis of the new purchase. This rule prevents people from claiming losses just for the tax benefit while keeping the same investment.

If I sell a mutual fund, do I pay capital gains tax on the whole amount?

No. You pay tax only on the gain — the difference between what you sold it for and what you paid for it (your cost basis). If you bought shares worth $10,000 and sold them for $12,000, your gain is $2,000, and that's what gets taxed. The fund company reports your cost basis on Form 1099-B.

Can I deduct investment losses against my salary or wages?

Only up to $3,000 per year. If your capital losses exceed your gains by more than $3,000, you can deduct $3,000 against your ordinary income. The remaining loss carries forward to next year, where you can use it again.

How do I know if a dividend is may have access to or non-may have access to?

Your broker reports this on Form 1099-DIV. Generally, dividends from U.S. corporations are may have access to if you held the stock for more than 60 days around the ex-dividend date. Dividends from money market funds, bonds, and REITs are usually non-may have access to. Your tax software uses this information to explore the correct tax rate.

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.