All journal notes
Taxes and investing10 min read

How Are Stocks Taxed? Capital Gains, Dividends, and Cost Basis

How are stocks taxed? Learn the basic U.S. rules for capital gains, dividends, cost basis, and taxable brokerage accounts without confusing a historical return with a tax result.

How are stocks taxed? In a basic U.S. taxable brokerage account, tax usually enters the picture when an investment pays income or when you sell an investment for more or less than its adjusted cost. A stock can rise in value on a statement without creating a realized capital gain that year. A dividend can be taxable even when it is automatically reinvested.

The details depend on the account, the security, the holding period, the cost basis, and the taxpayer's situation. This is a plain-language overview of common U.S. federal concepts, not tax-return instructions or personalized tax advice.

How are stocks taxed? The short answer

What happenedWhat it usually meansRecord to look for
The share price rose, but you did not sellAn unrealized change in valueBrokerage statement
A company paid a dividendDividend income may be reportable, even if reinvestedForm 1099-DIV
You sold sharesThe proceeds are compared with adjusted cost basisForm 1099-B, Form 8949, and Schedule D when required
A fund made a capital gain distributionA distribution may be reportable even if you did not sell your fund sharesForm 1099-DIV and fund records
A split, merger, or return of capital occurredYour basis or lot records may need an adjustmentBroker and issuer records

The IRS overview of capital gains and losses describes stocks and bonds held as investments as capital assets. Its basic calculation is familiar: compare what you received when you sold with the adjusted basis of what you sold. The hard part is making sure both numbers describe the same shares and adjustments.

A price gain is not the same as a realized gain

Suppose you buy 10 shares at $50 each. Your starting cost is $500. The shares later appear in your account at $65 each, so the market value is $650 and the unrealized change is $150.

If you do not sell, the account has a paper gain. If you sell all 10 shares for $650, the $150 difference is generally a realized capital gain before any adjustments or selling costs. The sale is the event that turns the change in the statement into a transaction that must be evaluated for tax reporting.

This distinction matters when reading a portfolio chart. A current account value can contain gains that have not been realized. It can also reflect dividends, new deposits, withdrawals, fees, and several tax lots. Looking only at the final value is not enough to calculate an individual's tax result.

Short-term vs. long-term capital gains

The length of time you held the shares affects how a gain or loss is classified. The IRS generally treats property held for one year or less as short-term and property held for more than one year as long-term. Special situations can change the result, so the dates in your records matter.

The distinction is important because net short-term capital gains are generally taxed as ordinary income. Net long-term capital gains may receive different rates based on overall taxable income and other rules. There is no single stock tax rate that applies to every person or every sale.

For a sale, write down:

  • the acquisition date for the shares sold;
  • the sale date;
  • the number of shares in that lot;
  • the adjusted basis; and
  • the proceeds reported by the broker.

The IRS capital gains guidance explains how gains and losses are classified and where most transactions are reported. Use the guidance for the tax year involved because thresholds, forms, and instructions can change.

Dividends can create taxable income

Dividends are separate from the price change of a share. A company can distribute cash, additional shares, or other property to shareholders. The IRS distinguishes ordinary dividends from qualified dividends, and the requirements for qualified treatment include the payer and the shareholder's holding period.

One easy mistake is assuming that reinvestment makes a dividend disappear for tax purposes. It does not. If a dividend is used to buy more shares, the distribution may still be reported as dividend income, and the reinvested amount generally becomes part of the basis of the new shares.

Your broker or fund company may provide Form 1099-DIV information. The form can distinguish ordinary dividends, qualified dividends, capital gain distributions, and other categories. Keep the form with the rest of your tax records rather than treating every distribution as the same kind of income.

Mutual funds and real estate investment trusts can also make capital gain distributions. That can happen even when you did not personally sell your fund shares. IRS Publication 550 explains the common categories of investment income and how distributions can affect reporting and basis.

Cost basis is the number behind a stock gain or loss

Cost basis is not always just the number you remember transferring into a brokerage account. For a purchased security, the starting basis is generally the purchase price, with certain purchase costs and later adjustments taken into account. Stock splits, nondividend distributions, mergers, and reinvested distributions can change the record.

Multiple purchases create multiple lots. Consider this simplified example:

  • 100 shares bought at $20, for a $2,000 lot basis;
  • 50 shares bought later at $30, for a $1,500 lot basis; and
  • 50 shares sold at $35, for $1,750 of proceeds.

If the shares sold came from the first lot, the illustrated gain is $750. If the identified shares came from the second lot, the illustrated gain is $250. The sale proceeds are the same, but the lot basis is different.

That is why a tax calculation cannot be reconstructed from a chart alone. You need the shares, dates, basis, and any adjustments. The SEC's Investor.gov guide to brokerage statements explains where investors can find cost basis and dividend information in account records.

Taxable brokerage accounts are not retirement accounts

This article is focused on a taxable brokerage account. Traditional IRAs, Roth IRAs, 401(k) plans, and other qualified retirement arrangements have their own contribution, distribution, and tax rules. The IRS specifically notes that the investment-income rules in Publication 550 do not apply to investments held in IRAs, 401(k) plans, and other qualified retirement plans in the same way.

Do not copy a taxable-account example into a retirement-account decision. The account wrapper can change when income is recognized, how distributions are treated, and what forms or penalties may apply. Check the plan documents and current IRS guidance for the account you actually use.

How stock taxes appear in common tax documents

The forms are clues, not a substitute for reviewing the underlying transactions.

  • Form 1099-DIV: Commonly reports dividends and certain fund distributions.
  • Form 1099-B: Commonly reports proceeds from broker-reported sales and may include basis information.
  • Form 8949: Used for many sales and other capital transactions when required.
  • Schedule D: Summarizes capital gains and losses when required.

The IRS Topic 409 instructions describe the usual relationship between Form 8949, Schedule D, and Form 1040. A corrected broker form, a missing lot, a corporate action, or a basis adjustment can change the work required. Keep the broker's transaction history, not just the year-end balance.

What about losses?

Selling an investment below its adjusted basis can create a capital loss. Losses and gains are netted under tax rules, and a net loss may be subject to deduction limits and carryover rules. The treatment is not simply “every losing trade creates a refund.”

Wash-sale rules and other special provisions can also affect whether a loss is currently recognized. Because those rules depend on the transactions around the sale, a short article cannot determine the result for a specific account. Review the current IRS capital-loss guidance and consult a qualified tax professional when the transaction history is complicated.

Why an ETF return and a tax result can differ

An ETF or stock can show a positive historical price change while an investor's taxable result is different. The investor may have bought at another price, received dividends, sold only one lot, paid fees, or held the position in a different account. A fund may also distribute capital gains.

The phrase “the stock returned 20%” therefore needs context. Was that price return or total return? Did it include dividends? Which dates were used? Was the result before fees and taxes? Were there deposits, withdrawals, or multiple purchases?

Equity Replay's historical portfolio replays answer a narrower question. They apply selected weights to historical closing-price movement and turn the observed change into an illustrative result. They do not model personal tax lots, dividends, fees, deposits, withdrawals, trading execution, or after-tax account value.

You can compare stocks over time, use the investment return calculator, or build an illustrative portfolio to inspect a historical scenario. For the difference between a historical replay and a full backtest, read backtesting vs. historical portfolio replay. A replay is useful for understanding the selected price path. It is not a tax statement or a forecast.

Common mistakes when thinking about stock taxes

  • Taxing the current account value instead of the realized transaction. A statement value can include unrealized gains and losses.
  • Forgetting reinvested dividends. Reinvestment can create income and new tax lots at the same time.
  • Using the first purchase price for every share. Multiple lots can have different bases and holding periods.
  • Assuming every dividend has the same treatment. Ordinary dividends, qualified dividends, and fund distributions can be reported differently.
  • Applying taxable-account rules to a retirement account. The account type is part of the tax question.
  • Using an old tax table without checking the year. Federal thresholds and instructions change.
  • Treating a historical chart as an after-tax return. Price movement and a person's tax result are different measurements.

A simple recordkeeping checklist

For each taxable investment account, keep a record of:

  1. Purchase and sale dates.
  2. Number of shares or units.
  3. Purchase price and proceeds.
  4. Broker fees or other basis adjustments shown in your records.
  5. Dividend and capital gain distribution forms.
  6. Stock splits, mergers, spin-offs, and return-of-capital notices.
  7. The lot-selection method used for a sale, when applicable.

The IRS Publication 550 investment-income guide is a useful reference for basis, dividends, capital gains, and reporting concepts. Use current forms and instructions when preparing a return. If the numbers are material or the account includes complex transactions, get advice for your own facts.

The short version

Stocks are commonly taxed through dividends and realized gains or losses in a taxable brokerage account. An unrealized price increase is not the same thing as a completed sale. When you sell, the result depends on proceeds, adjusted cost basis, the holding period, and the tax rules for the account. Reinvested dividends, fund distributions, and corporate actions can change the record.

Equity Replay is an educational historical simulator, not a broker, tax adviser, or record of trades. Its charts and calculators show illustrative historical price movement and do not calculate personal taxes, after-tax returns, dividends, fees, deposits, withdrawals, or future results. This article is general education, not a recommendation to buy, hold, sell, or rebalance an investment.

Sources and further reading

About our educational content

Published by Equity Replay, an educational historical portfolio simulator operated by Quadri LLC. We use AI-assisted drafting. No independent financial, legal, or tax expert review is claimed.

Check the linked sources, article dates, and stated assumptions before relying on a number. Historical simulations are not forecasts, records of trades, or personal investment advice. Rules and market data can change after publication.

Found an error? Send a correction to our team.