Stocks For Beginners

Plain-English money basics for people just starting out

Taxes & Paperwork

Capital Gains Tax When You Sell a Stock

Selling a stock can trigger capital gains tax. Learn how US short-term vs long-term gains work, how gain or loss is calculated, and what to expect at tax time.

When you sell a stock for more than you paid, that “extra” can be taxed as a capital gain. When you sell for less, you may have a capital loss, which can potentially help at tax time.

This guide explains what typically happens in the US when you sell a stock, especially the big beginner questions: short-term vs long-term rates, how the gain is calculated, and what forms you’ll see.

A quiet tree-lined city square with stone benches and a fountain in the early morning, a few people walking, no vehicles, no shop fronts

Capital gains tax in one bite

Capital gains tax is the tax that can apply when you sell an investment (like a stock or ETF) for a profit. The key idea is simple:

  • If you sell higher than your cost: you have a gain (potentially taxable).
  • If you sell lower than your cost: you have a loss (may reduce taxes).

The holding period matters a lot. In the US, gains are generally split into short-term (held 1 year or less) and long-term (held more than 1 year). For edge cases, the IRS measurement is date-based, and the clock generally starts the day after you buy and runs through your sale date.

Short-term vs long-term gains

Short-term capital gains (held 1 year or less)

Short-term gains are typically taxed at your ordinary income tax rates, the same tax brackets that apply to wages and most other regular income. That is why short-term gains can feel “pricier” than long-term gains.

Long-term capital gains (held more than 1 year)

Long-term gains typically get preferential tax rates (often lower than ordinary income rates). The exact rate depends on your taxable income.

Want to zoom out and understand what you actually own when you buy shares? Pop over to What Is a Stock?.

How gain or loss is calculated

You are generally taxed on the gain, not the full sale proceeds. Practically, that means taxes usually come down to the difference between what you sold for and your cost basis.

Key terms beginners should know

  • Proceeds: what your sale brought in. On tax forms like the 1099-B, proceeds are often shown as gross proceeds (before certain fees). Fees and commissions affect your net result and may be reflected in proceeds, basis, or separate reporting, depending on how your broker reports.
  • Cost basis: what you paid to buy, plus any adjustments. Many brokers have $0 commissions now, but some fees and adjustments can still matter, and your brokerage typically tracks basis for you.
  • Capital gain or loss: proceeds minus cost basis.

A quick example

If you buy 10 shares for $50 each, your purchase cost is $500. If you later sell those 10 shares for $70 each, your gross sale proceeds are $700. Your capital gain is $200, before considering any fees or reporting adjustments your broker applies.

If you sell for $40 each instead, your gross proceeds are $400 and your capital loss is $100.

US tax paperwork and a calculator spread across a kitchen table next to a pen and a mug

Cost basis when you buy in pieces

Many investors add money over time, which means you might buy the same stock on multiple dates at multiple prices. When you sell, your brokerage has to decide which shares you sold, because that affects your gain, your holding period, and your taxes.

Common cost basis methods

  • FIFO (first in, first out): the earliest shares you bought are treated as the first shares you sold.
  • Specific identification: you choose which shares to sell (if your brokerage supports it and you follow their steps on time).
  • Average cost: commonly available for mutual funds (and sometimes certain fund reporting), but generally not used for individual stocks.

Brokerages often default to FIFO unless you set something different. If you are not sure what your account is using, check your brokerage’s “cost basis” settings before you sell.

What happens at tax time

If you sell stocks in a regular taxable brokerage account, you’ll usually see a tax form that reports your sales for the year.

Form 1099-B (and 1099-DIV)

  • 1099-B typically reports your sales proceeds and often your cost basis and whether the gain is short-term or long-term.
  • 1099-DIV reports dividends you received. It can also report capital gain distributions from mutual funds and some ETFs, even if you did not sell anything.

Your tax software or tax preparer typically uses information from these forms to fill out Form 8949 and Schedule D (the IRS forms for capital gains and losses).

On Stocks For Beginners, the Taxes & Paperwork section is where these kinds of “what form is this?” questions live.

One more acorn for the pocket: state taxes may apply too, depending on where you live.

Capital losses: the small silver lining

If you sold some investments at a loss, those losses can often help offset gains.

  • Gains and losses net against each other. If you have $500 in gains and $300 in losses, you may only owe tax on a net $200 gain.
  • If losses exceed gains, you may be able to use up to $3,000 of net capital loss per year against other income (or $1,500 if married filing separately). Any remaining loss is typically carried forward to future years (rules apply).

This is one reason it can be helpful to keep good records and not ignore “small” losing trades when tax time arrives.

Special situations

If you reinvested dividends

Reinvesting dividends can increase your cost basis because those reinvested dividends buy additional shares. Dividends themselves may still be taxable in the year you receive them, depending on the type of dividend and your situation. Some dividends are “qualified” and may get lower rates, while others are taxed like ordinary income.

ETFs and index funds

ETFs and mutual funds can distribute dividends and capital gains. Those distributions can create taxes in a taxable account even if you did not sell. If you are deciding between fund types, see Index Funds vs Mutual Funds and What Is an ETF and How Does It Work?.

Selling inside a retirement account

In many retirement accounts (like traditional IRAs and Roth IRAs), trades inside the account typically do not create a capital gains tax bill each year the way they do in a regular taxable brokerage account. Instead, retirement accounts have their own rules about contributions and withdrawals. Traditional accounts are typically taxed when you take distributions, while Roth accounts can allow tax-free qualified withdrawals if you meet the rules.

The wash sale rule (quick heads-up)

If you sell a stock at a loss and buy the same or a “substantially identical” investment again within 30 days before or 30 days after the sale (a 61-day window), the wash sale rule can prevent you from claiming that loss right away. This can also be triggered across accounts you control, and sometimes even a spouse’s account. It can get especially messy around IRAs, so it is worth extra care if you do quick sell and buy-back trades.

Checklist before you sell

  • Check your holding period. Are you close to crossing the 1-year mark for long-term treatment?
  • Confirm your cost basis method. FIFO vs specific identification can change the result.
  • Estimate your gain. A quick “sale price minus cost” estimate helps avoid surprises.
  • Set aside cash for taxes if needed. Especially for big short-term gains.
  • Save your statements. Your brokerage will usually provide forms later, but records are still your friend.

If you are just getting started overall, Investing Basics is the home base for the first steps.

Important note from Pocket

Tax rules can change and your situation can be unique. This guide is for general education, not individualized tax advice. If you have a complex situation, a qualified tax pro can help you apply the rules correctly.

When you’re ready, the big takeaway is comforting: capital gains tax is mostly just math plus timing. Know what you paid, know what you sold for, and know how long you held. Those are the acorns that make tax season much less scary.

Pocket is the squirrel drawn for Stocks For Beginners. Pocket isn't a financial adviser and doesn't pick stocks. The articles explain how accounts, funds, credit and taxes work so you can make your own decisions. More about Pocket