Taxes
Investing Taxes

Capital Gains Taxes Explained

Capital gains tax is the tax on selling something for more than it cost you. The rules reward patience, count losses, and only ever apply when you actually sell, which makes timing the one tax lever every investor holds.

Quick definition

A capital gain is the sale price of an investment minus its cost basis. In a regular taxable account, realized gains are taxable, and how long you held the asset decides whether the gain is short-term or long-term, which changes the rate.

General education about United States federal rules. Rules change and states differ. Last reviewed June 12, 2026.

Why it matters

Realization is the heart of the system, and most beginners have never heard the word. An investment can double on paper for years without creating a federal tax bill in a taxable account; the tax event happens when you sell. Understanding that single idea explains most of how long-term investors think about taxes.

The holding-period split is the next biggest lever. Gains on assets held past the long-term line are generally taxed at lower rates than gains taken quickly, which are taxed like wages. The IRS publishes the current rate thresholds each year; the structure, long-term is gentler than short-term, is the durable part worth learning.

Losses are not wasted, and gains are not the whole story. The rules let realized losses offset realized gains, with a limited amount usable against ordinary income and the rest carried forward. Knowing the mechanics, without turning them into a strategy, keeps a bad year from being misread as pure waste.

How it works

  1. 1

    Cost basis is your starting line

    Basis is generally what you paid for the investment, including costs of the purchase. Sell above it and the difference is a gain; sell below it and the difference is a loss. Reinvested dividends you already paid tax on add to basis, which matters later so the same dollars are not taxed twice.

  2. 2

    Nothing is taxed until you realize it

    In a regular taxable account, a gain that exists only on a screen is unrealized and generally creates no federal tax bill. Selling converts it into a realized gain, and that is the taxable event. This is why holding an index fund for a decade can be quiet, tax-wise, while frequent trading is noisy.

  3. 3

    The holding period sorts gains into two lanes

    Assets held more than a year before selling generally produce long-term gains, taxed at lower rates. Assets sold within that window produce short-term gains, taxed like ordinary wage income. The IRS publishes the current long-term rate thresholds; the lesson here is the split itself, which has been the shape of the system for decades.

  4. 4

    Losses offset gains, by rule

    Realized losses net against realized gains. When losses exceed gains, a limited amount can offset ordinary income in that year, and the remainder carries forward to future years. These are the mechanics the rules define, not a technique: what they mean for any real portfolio is a professional conversation.

  5. 5

    The account changes everything

    All of the above describes regular taxable accounts. Inside tax-advantaged retirement accounts, buying and selling does not create yearly capital gains tax; those accounts follow their own contribution and withdrawal rules instead. The Financial Literacy lesson linked below covers that landscape.

  6. 6

    A primary home has its own rule

    Selling the home you live in can qualify for an exclusion that shields part of the gain, within limits and conditions the IRS defines. It is worth knowing the rule exists before assuming a home sale is taxed like a stock sale. The conditions are specific, so this is a flag to read further, not guidance.

Practical example

Invented, simplified figures that show the mechanics. Never real rates, quotes, or predictions.

The same profit in two lanes, simplified

Suppose an investor buys shares for $5,000 and later sells them for $8,000, a $3,000 realized gain. Imagine her invented ordinary rate is 22 percent and her invented long-term rate is 15 percent. Sold inside the short-term window, the gain is taxed like wages: $660. Held past the long-term line first, the same gain is taxed at the lower rate: $450. Identical investment, identical profit, $210 of difference purely from the holding period. The rates here are invented to show the shape; the IRS publishes the real ones for each year.

Common mistakes

  • Forgetting that reinvested dividends raised your basis, and overpaying by reporting the original purchase price at sale time.
  • Believing unsold gains are taxed every year in a regular account. Realization, not appreciation, is the taxable event.
  • Selling just inside the short-term window without checking the calendar, when the long-term line was days away.
  • Treating realized losses as meaningless, when the rules let them offset gains and carry forward.
  • Assuming fund investing avoids all of this: mutual funds can distribute taxable gains to holders even in years you sold nothing, which arrives on the same tax forms.

How to apply it

Orientation pointers for learning, never filing instructions or advice.

  • Find the basis and acquisition date your brokerage reports for each holding; this is the raw material of every gains question.
  • Before any planned sale, check the holding period against the calendar so short-term versus long-term is a decision, not an accident.
  • Read the How Investing Is Taxed lesson for the account-level picture this page plugs into.
  • Bookmark IRS Topic 409, the canonical page for the current capital gains rules and thresholds.

Worth asking a tax professional

These pages teach how the system works. For what it means for you, these are the questions worth bringing to someone qualified.

  • Ask how a large planned sale would interact with the rest of your income in the same year.
  • Ask what your realized gains and losses netted to last year, and what any carryforward means for you.
  • Ask how the home sale exclusion conditions apply to your situation before selling a residence you have also rented out or lived in part-time.
  • Ask what basis records you need for assets received as gifts or inheritance, where the starting line follows special rules.

Frequently asked questions

Do I pay taxes on stocks I have not sold?

Generally not on the price growth itself in a regular taxable account: unrealized gains are not a federal taxable event. You can still owe tax along the way on dividends the stock or fund pays, and mutual funds can distribute taxable gains to holders. The gain on your shares becomes taxable when you sell.

What is cost basis?

Your starting line for measuring gain or loss: generally the price you paid plus certain costs of buying, adjusted over time. Reinvested dividends add to basis because you already paid tax on them as income. Sale price minus basis is the gain or loss the tax calculation uses.

What counts as a long-term capital gain?

Generally, gain on an asset held more than one year before selling. Long-term gains use lower rates than short-term gains, which are taxed like ordinary income. The IRS publishes the current rate thresholds, which change with the tax year.

How do capital losses work?

Realized losses first offset realized gains. If losses win, a limited amount can offset ordinary income in that year, and the rest carries forward to future years. Those are the mechanics; whether and when realizing a loss makes sense for a real person is a question for a qualified professional.

Does selling my home trigger capital gains tax?

Sometimes, and sometimes not: the rules include an exclusion that can shield part of the gain on a primary residence, subject to ownership and use conditions the IRS defines in Topic 701. Whether you qualify, and for how much, depends on specifics worth confirming professionally.

Are trades inside a 401(k) or IRA taxed as capital gains?

No. Tax-advantaged retirement accounts do not produce yearly capital gains tax on trades inside them. They follow their own rules about contributions and withdrawals instead, which the retirement lessons linked on this page explain.

Is this tax advice?

No. This page is general education only and is not personalized tax, financial, or investment advice. Tax rules vary by location and change over time, so for your own situation consult a qualified tax professional.

Related tools

Calculator projections are pre-tax; these lessons explain the part the tools leave out.

Related concepts

Related money lessons

The money habits every tax question sits on.

Related guides

Keep exploring

Live pages on this site where these ideas play out. Examples for research, not suggestions.

More tax lessons

Free newsletter

Clearer money decisions, twice a week

Markets, taxes, and money education in plain English. Always free.

Two short emails a week. Free.

Sources and last reviewed

Rules and figures on this page were checked against the sources above. Last reviewed June 12, 2026.

Educational content only. This is general information about how United States federal taxes work, not tax, legal, accounting, investment, or financial advice, and not a recommendation about filing, deductions, or strategy. Tax rules change and vary by state and situation. Examples are simplified and hypothetical. For personal decisions, consult a qualified tax professional.