0 day streak0 points

How stocks are taxed

Learn what part of a stock sale is taxed and how holding time, dividends, losses and accounts change it.

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

Quick answer

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.

    The full lesson

    Everything the quiz covers, in one place. Stuck on a question? Tap See it in the lesson and the right part lights up in yellow.

    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 lesson in 4 ideas

    1. The gainProceeds, gain and tax owed are three different amounts.
    2. Holding timeOne day past a year moves a gain from ordinary income rates to the long term rates of 0%, 15% or 20%.
    3. DividendsDividends are income in the year they arrive, and a loss is a deduction, not a refund.
    4. AccountsTrades inside an IRA or 401(k) are not taxed when they happen, and good records are what prove your basis.
    Part 1 of 5 · The gain

    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.

    Part 2 of 5 · Holding time

    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.
    Original U.S. illustration: one year or less is generally short term; more than one year is long term.

    2026 long term capital gains rate, single filer, up to $120,000 of taxable income

    0% rate15% rate$0$49,450$120,000$83,000 example
    The rate depends on total taxable income including the gain: 0% up to $49,450, 15% from there to $545,500, and 20% above that (off the scale). In the worked example, $80,000 of other income plus a $3,000 gain lands at $83,000, in the 15% zone; $40,000 plus $3,000 lands at $43,000, in the 0% zone. Source: IRS Revenue Procedure 2025 32.

    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 generally moves a gain from ordinary income rates to the 0%, 15% or 20% long term rates.

    Part 3 of 5 · Dividends

    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 for now. Purchases in your IRA or Roth IRA count too, and there the loss can be gone for good, so check every related account first.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.

    Part 4 of 5 · Accounts

    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.
    The rule

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

    Part 5 of 5 · Accounts

    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.
    The original tax-concepts overview: gains, losses, records and tax drag. Deductions and carryforwards are subject to local eligibility and limits.
    The rule

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

    FAQ · How stocks are taxed

    Questions people ask

    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.

    Get this lesson on one card

    We will email you the takeaway card for How stocks are taxed, plus one short lesson a week.

    Free. No spam. Unsubscribe any time.
    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. Nothing here recommends a specific security or allocation. Investing involves risk, including the loss of money you invest.

    Free beginner guide

    New to Investing? Start With Our Free Guide

    20 pages on the basics, 6 safe ways to use AI, and a 10 question quiz. Free in your inbox.

    Free PDF in your inbox. No spam. Unsubscribe any time.

    Learning Path IncludedEvery lesson in the right order, freeGet the Free Guide

    AI Robot

    Ask the
    Stock AI Assistant

    Get instant educational answers about
    stocks, investing, and StockEducation.com.

    Instant Answers Built With Learners

    Educational support only. Not personal financial advice. AI responses may contain errors.

    Powered by AI ●

    The Ultimate Investing Starter Guide

    Free Stock Market
    Investing Guide

    A beginner friendly guide that covers the essential lessons and concepts every new investor should understand.

    Beginner Investing Guide Form

    Inside You'll Learn

    Stocks & How They Work
    Valuation Basics
    Compound Interest
    Index Funds & Diversification
    Warren Buffett Principles
    AI Stock Research & More
    20+ Pages
    of Value
    Instant
    Download
    100% Free
    No Strings