Module 10 · 10 min read

How stocks are taxed

Separate sale proceeds from investment gains, learn how holding periods, dividends and losses are taxed in the U.S. and find the official IRS rules.

Written by the StockEducation Editorial Team · Reviewed by Associate Professor Charles Lo, CPA, PhD · Updated · How we check lessons

Quick answer

How are stocks taxed?

In the U.S., stocks in a taxable account are generally taxed when you sell at a gain or receive dividends, not while the price simply rises. The gain is your sale proceeds minus your adjusted basis. Shares held more than one year generally produce long term gains taxed at 0%, 15% or 20%, while short term gains are taxed as ordinary income.

Key takeaways

  1. Sale proceeds minus adjusted basis give the gain or loss; the gain is not itself the tax bill.
  2. Shares held more than one year generally qualify for long term rates of 0%, 15% or 20%; gains on shares held a year or less are taxed as ordinary income.
  3. For a single filer with $80,000 of other taxable income in 2026, a $3,000 gain costs $660 in federal tax if short term and $450 if long term.
  4. Dividends can be taxable without a sale, and reinvesting them does not make them tax free.
  5. Net capital losses can offset up to $3,000 of other income a year, but wash sale rules can delay a loss.
  6. Keep your own records and use the rules for your country, account and tax year.
The original capital-gains illustration: a taxable sale can create a gain after adjusting the cost basis and selling proceeds. Account type and local rules matter.
The original capital-gains illustration: a taxable sale can create a gain after adjusting the cost basis and selling proceeds. Account type and local rules matter. View full-size image

Start the lessonTake the quick checkRead the FAQSee the sources

All 5 parts of this lesson

Part 1 of 5 · Gain versus proceeds

What part of a stock sale is taxed?

You are taxed on your gain, not on the sale price. For a U.S. stock sale, start with the amount you received and subtract your adjusted basis, which is roughly what the shares cost you. A positive result is a capital gain; a negative result is a capital loss.1

Say your net sale proceeds are $1,300 and the shares’ adjusted basis is $1,000. The difference is a $300 gain before any tax is worked out. The full $1,300 is not profit, and the $300 is not the tax bill either.

Hypothetical: from sale proceeds to taxable gain

$0$500$1,000$1,500$1,300Net proceeds−$1,000Adjusted basis$300Gain
Net proceeds of $1,300 minus an adjusted basis of $1,000 leave a $300 gain. The tax is then worked out on the $300, not on the $1,300.

Move the net sale proceeds in the calculator while the adjusted basis stays at $1,000, and the result switches between a gain, a loss and zero. It shows the first step only, not a tax bill.

Separate proceeds from gain

Hypothetical · no tax rate
Given adjusted basis$1,000
Illustrative capital gain$300

$1,300 − $1,000 = $300 gain

U.S. dollar illustration only. Net proceeds and adjusted basis are given. No dividends, exchange rates, additional costs, loss restrictions, other transactions or tax rate are calculated.

A price rise while you still own the shares is generally unrealized, which means it is not taxed yet. A sale or another relevant event changes that. Dividends are different again: they can create taxable income without any sale, so “I did not sell” is not a complete tax check.

Why your basis may differ from the purchase price

U.S. stock basis can include purchase commissions and other acquisition costs. Gifts, inheritances and later adjustments follow their own rules.2 In the example above, the $1,000 basis already includes costs and the $1,300 is already net, so a cost is never subtracted twice.

The rule

Proceeds, gain and tax owed are three different amounts.

Marks Part 1 done

Part 2 of 5 · Holding period

How does your holding period change the tax?

Hold shares more than one year and a gain is generally long term; hold them one year or less and it is short term. Exceptions apply.1 Net short term gains are taxed at your ordinary income rates. Net long term gains are taxed at 0%, 15% or 20%, depending on your taxable income.1

For 2026, a single filer’s long term gains within the first $49,450 of taxable income are taxed at 0%, and the 15% rate applies up to $545,500.3

Original U.S. illustration: one year or less is generally short term; more than one year is long term. The loss deduction against other income is generally capped at $3,000, or $1,500 for married filing separately. State tax, special assets and the net investment income tax can change the result.
Original U.S. illustration: one year or less is generally short term; more than one year is long term. The loss deduction against other income is generally capped at $3,000, or $1,500 for married filing separately. State tax, special assets and the net investment income tax can change the result. View full-size image

Worked example

A single filer sells shares for $13,000 that cost $10,000, a $3,000 gain. Using the 2026 brackets, here is the federal tax on that gain for two people with different incomes.3

Federal tax on a $3,000 gain, single filer, 2026 (hypothetical)

$0$200$400$600$800$360$0$40,000 income$660$450$80,000 income

Held a year or less Held over a year

The gain is added on top of the filer’s other taxable income. Short term gains use the ordinary brackets: 12% at $40,000 ($360) and 22% at $80,000 ($660). Long term gains use the 0% rate up to $49,450 of taxable income ($0) and 15% above it ($450). State tax and the net investment income tax are left out. Source: IRS Revenue Procedure 2025 32, 2026 brackets and capital gain thresholds.

At $80,000 of other taxable income, waiting past the one year mark cuts the tax on the gain from $660 to $450. At $40,000, it cuts it from $360 to zero, because the whole gain fits under the $49,450 limit for the 0% rate.

That is a real saving, though a longer holding period does not by itself make an investment better. State taxes and the 3.8% net investment income tax for higher earners are not included here.

The rule

One day past a year moves a gain from ordinary income rates to the 0%, 15% or 20% long term rates.

Marks Part 2 done

Part 3 of 5 · Dividends and losses

How are dividends and losses taxed?

In a taxable U.S. account, dividends can be taxable even when you sell nothing. Some dividends, called qualified dividends, get the lower capital gain rates if conditions are met; the rest are taxed as ordinary income. The dividend version of Form 1099 your broker sends each year shows which is which.4

Reinvesting a dividend does not make it tax free. It is still income for the year, and the shares it buys get a basis equal to the reinvested amount.5,6 Keep those records, because that basis reduces your taxable gain when you eventually sell.

Capital losses

U.S. capital losses are first netted against your gains. If losses are bigger, up to $3,000 of the excess ($1,500 if married filing separately) can be deducted from other income each year, and the rest carries forward to later years.1 A loss is a deduction, not a dollar for dollar refund.

Worked example

Suppose $5,000 of losses and $1,000 of gains in the same year. The losses first wipe out the $1,000 of gains. Of the $4,000 left, $3,000 reduces other income this year and $1,000 carries forward.

Hypothetical: where $5,000 of capital losses goes

$0$2,000$4,000$6,000$5,000Losses−$1,000Offset gains−$3,000Against income$1,000Carriedforward
Losses first offset the year’s $1,000 of gains, then up to $3,000 reduces other income, and the remaining $1,000 carries forward to a later year.

The wash sale rule

If you sell at a loss and buy substantially identical securities within 30 days before or after the sale, U.S. wash sale rules can disallow the loss. A replacement purchase in an IRA or Roth IRA does not increase the IRA’s basis. That includes purchases in your IRA or Roth IRA, so a loss only counts once every related account has been checked.6,7

The wash sale window: 61 days around a loss sale

  1. Day −30
    Window opensA purchase from here on counts
  2. Day 0
    Loss saleShares sold below their basis
  3. Day +30
    Window closesPurchases after this do not trigger the rule
A purchase of substantially identical securities anywhere in the window, in any related account, can disallow the loss for now. The disallowed amount is generally added to the basis of the replacement shares. Source: IRS, Instructions for Schedule D, wash sales.
The rule

Dividends are income in the year they arrive, and a loss is a deduction, not a refund.

Marks Part 3 done

Part 4 of 5 · Accounts and countries

Do your account and country change the answer?

Trades inside an IRA or 401(k) are generally not taxed when they happen. In traditional accounts, tax usually comes when you withdraw; qualified Roth withdrawals can be tax free.8 Eligibility, contribution limits, early withdrawal rules and reporting all need their own checks.

Outside the U.S., or with foreign investments, a U.S. rule does not carry over. Tax residence, the account, the investment and the tax year decide the treatment, and cross border holdings can add withholding tax and more than one reporting duty.

The original cross-country checklist: gains, losses, account shelters, dividends and cross-border reporting need local rules.
The original cross-country checklist: gains, losses, account shelters, dividends and cross-border reporting need local rules. View full-size image
The rule

Trades inside an IRA or 401(k) are not taxed when they happen; the account’s withdrawal rules decide the tax.

Marks Part 4 done

Part 5 of 5 · Records

What records should you keep?

Good records turn tax time from guessing into arithmetic. The Form 1099 your broker sends for sales is a starting point, not a substitute for checking that it is right.6

  1. Keep every trade. Save the purchase and sale dates, share counts, prices and costs for each lot.
  2. Support your basis. Keep records of commissions, reinvested dividends and any gift or inheritance details.
  3. Track income as it arrives. Keep each dividend Form 1099 and your account statements for distributions.
  4. Compute the gain yourself. Net proceeds minus adjusted basis. A result below zero is a loss, but it is not yet an allowable deduction until netting and wash sale rules are checked.
  5. List what the math cannot answer. Which year and country apply, which income type and account rules matter, and any missing records or special transactions are questions for a qualified tax professional.
The original tax-concepts overview: gains, losses, records and tax drag. Deductions and carryforwards are subject to local eligibility and limits.
The original tax-concepts overview: gains, losses, records and tax drag. Deductions and carryforwards are subject to local eligibility and limits. View full-size image
The rule

A broker’s Form 1099 is a starting point; the lot records are what prove the basis.

Marks Part 5 done

Quick check

Quick quiz: test what you just read

Pick an answer to see why it is right. 5 questions, no account needed.

0 of 5 answered

1. You sell shares for net proceeds of $1,300. Their adjusted basis is $1,000. What is taxed?

Answer: B.Capital gains tax applies to proceeds minus adjusted basis, so the $300 gain is the starting point. The tax bill is a percentage of that, not the whole $300.

2. For 2026, a single filer with $40,000 of other taxable income sells shares held 14 months for a $3,000 gain. What federal tax is due on the gain?

Answer: A.The gain is long term and total taxable income of $43,000 sits under the $49,450 limit for the 0% rate. Held a year or less, it would be taxed at 12%, or $360.

3. Reinvesting a dividend in more shares means the dividend is:

Answer: B.In a taxable account the dividend is income whether taken in cash or reinvested. The reinvested amount becomes basis in the new shares, which lowers a later gain.

4. You have $5,000 of capital losses and $1,000 of gains this year. How much can be deducted from other income?

Answer: C.Losses first offset the $1,000 of gains. Of the remaining $4,000, up to $3,000 ($1,500 if married filing separately) offsets other income, and $1,000 carries forward.

5. Which of these can trigger the wash sale rule after you sell a stock at a loss?

Answer: A.The rule covers substantially identical securities bought within 30 days before or after the sale, including in related accounts such as an IRA.

Questions people ask

How stocks are taxed FAQ

What is a wash sale?

It happens when you sell a security at a loss and buy substantially identical stock or securities within 30 days before or after the sale.7 U.S. rules can then disallow the loss for now; for a usual taxable replacement, the disallowed amount is generally added to the new shares’ basis. Purchases in related accounts, such as an IRA, can also trigger the rule.

Can capital losses lower my taxes?

Yes. Losses first offset gains, then up to $3,000 a year of the excess ($1,500 if married filing separately) can offset other income, with the rest carried forward.1 A fall in price only counts once you actually sell.

Are reinvested dividends taxable?

In a taxable U.S. account, generally yes. The dividend is income for the year whether you take cash or buy more shares.5 Each reinvestment adds to your cost basis, which lowers your taxable gain when you sell.

What is cost basis?

Cost basis is generally what you paid for an investment, including commissions and other acquisition costs, adjusted for later events. Selling shares for $1,300 with a $1,000 basis produces a $300 gain, not $1,300 of profit. Gifts and inheritances follow their own basis rules.2

Do I pay tax on trades inside an IRA or 401(k)?

Generally not when the trades happen. Traditional accounts are usually taxed when you withdraw, and qualified Roth withdrawals can be tax free.8 Confirm the current rules for your account.

Next steps

You finished this lesson.

You now have the main ideas from this lesson. Next, practice where mistakes cost nothing: a free account saves your progress and unlocks the practice simulator with virtual money.

Free, no card. Lessons stay free to read without an account.

Your notes on one card, and what comes next
  1. Step 1 · DoneHow stocks are taxed
    See your notes on one card
    1. Sale proceeds minus adjusted basis give the gain or loss; the gain is not itself the tax bill.
    2. Shares held more than one year generally qualify for long term rates of 0%, 15% or 20%; gains on shares held a year or less are taxed as ordinary income.
    3. For a single filer with $80,000 of other taxable income in 2026, a $3,000 gain costs $660 in federal tax if short term and $450 if long term.
    4. Dividends can be taxable without a sale, and reinvesting them does not make them tax free.
    5. Net capital losses can offset up to $3,000 of other income a year, but wash sale rules can delay a loss.
    6. Keep your own records and use the rules for your country, account and tax year.
  2. 2
    Step 2 · NowSave your progress with a free account

    Keep your course progress and practice on real U.S. stocks with virtual cash.

    Create your free account No card needed. Lessons stay free to read.
  3. 3
    Step 3Follow the learning path
    The learning pathFree

    Learn the rest in the right order

    Ten modules of lessons, videos, tools and quizzes, ordered so each step builds on the last, from market basics to company analysis and risk.

    Start the learning path

Want the full sequence? See the course outline →

Sources and assumptions

  1. IRS Topic 409: Capital Gains and Losses. U.S. capital asset gains, holding period categories and loss limits. Use applicable year rules; no rates or thresholds are supplied here
  2. IRS Topic 703: Basis of Assets. Acquisition costs, adjusted basis and special acquisition cases
  3. IRS Revenue Procedure 2025 32: 2026 tax brackets and capital gain thresholds
  4. IRS Topic 404: Dividends and Other Corporate Distributions. U.S. dividend categories and reporting context
  5. IRS: How reinvested dividends are reported
  6. IRS Publication 550: Investment Income and Expenses. Dividend reinvestment, wash sales and transaction records. Consult the edition and updates applicable to your year
  7. IRS: Instructions for Schedule D (Form 1040), wash sales and capital loss limits
  8. IRS: Traditional and Roth IRAs
  9. HMRC: Tax When You Sell Shares. UK share disposals, account exemptions and tax year allowances
  10. CRA: Investment Income. Canadian investment income categories and filing resources
  11. Japan NTA: Individual Income Tax. Current official guide and related taxpayer resources

StockEducation provides general education, not personal financial, tax or legal advice. Companies and funds named here are teaching examples only. Nothing here recommends buying or selling any security. Investing involves risk, including the loss of money you invest.

Up nextPart 1 · What part of a stock sale is taxed?
Next ↓