Taxes & Tax Planning

Capital Gains Taxes

GPF 204 · How Taxes Work

Capital gains taxes apply when you sell investments or assets for more than you paid. This lesson explains cost basis, short-term gains, long-term gains, losses, and why holding period can change tax treatment.

Key terms

Capital Gain = Sale Price − Cost BasisEstimated Tax = Capital Gain × Applicable Tax RateNet Capital Gain = Capital Gains − Capital Losses

Learning objectives

  • Calculate a capital gain using sale price and cost basis.
  • Distinguish short-term and long-term capital gains tax treatment.
  • Explain how capital losses can offset capital gains.

Capital gains taxes apply when you sell a capital asset, such as a stock, ETF, mutual fund, cryptocurrency, or real estate, for more than your cost basis. They matter because the timing and type of gain can affect how much tax you owe.

Capital Gains Basics

A capital gain is profit from selling an asset. Your cost basis is generally what you paid for the asset, adjusted for certain items such as reinvested dividends, splits, fees, or improvements for real estate.

The basic formula is:

Capital Gain=Sale PriceCost BasisCapital\ Gain = Sale\ Price - Cost\ Basis

If you buy stock for $8,000 and sell it for $11,000, your gain is:

\11,000 - $8,000 = $3,000$

If you sell for less than your basis, you have a capital loss. Losses can sometimes offset gains and a limited amount of ordinary income, subject to rules.

TermMeaning
Cost basisWhat you paid, adjusted when applicable
Capital gainSale price above basis
Capital lossSale price below basis
Realized gainGain after you sell
Unrealized gainGain while you still hold the asset

You generally do not owe capital gains tax just because an investment rises in value. The gain is usually taxable when it is realized through a sale.

Short-Term vs. Long-Term Capital Gains

The holding period matters. A short-term capital gain usually comes from selling an asset held for one year or less. It is generally taxed at ordinary income tax rates. A long-term capital gain usually comes from selling an asset held for more than one year. It may qualify for lower long-term capital gains rates.

For many taxpayers, long-term capital gains rates are 0%, 15%, or 20%, depending on taxable income. High-income taxpayers may also face the net investment income tax. State taxes may also apply.

Here is a simplified 2024 long-term capital gains rate table for common filing statuses:

Filing Status0% Rate Up To Taxable Income15% Rate Up To Taxable Income20% Rate Above
Single$47,025$518,900$518,900
Married Filing Jointly$94,050$583,750$583,750
Head of Household$63,000$551,350$551,350

These thresholds are examples for 2024 and can change. The main lesson is that long-term gains often receive more favorable treatment than short-term gains.

Worked Example: Selling After 11 Months vs. 13 Months

Suppose you buy shares of an ETF for $10,000 and later sell them for $14,000. Your gain is:

\14,000 - $10,000 = $4,000$

Now compare two holding periods.

Sale TimingHolding PeriodGain TypeTax Treatment
Sell after 11 monthsOne year or lessShort-term gainTaxed like ordinary income
Sell after 13 monthsMore than one yearLong-term gainMay qualify for lower capital gains rate

Suppose your ordinary marginal tax rate is 22% and your long-term capital gains rate is 15%. If you sell after 11 months, estimated federal tax on the gain is:

\4,000 \times 0.22 = $880$

If you sell after 13 months, estimated federal tax is:

\4,000 \times 0.15 = $600$

Difference:

\880 - $600 = $280$

Waiting until the gain qualifies as long-term saves $280 in this simplified example. Taxes should not be the only investment decision factor, but holding period can matter.

Capital Losses and Offsetting Gains

A capital loss can reduce taxable gains. If you sell one investment at a gain and another at a loss, the loss may offset the gain.

For example, suppose you sell Fund A for a $5,000 gain and Fund B for a $5,000 loss. The loss offsets the gain:

\5,000 - $5,000 = $0 \text{ net capital gain}$

This does not mean losing money is good. It means the tax code may soften the effect of losses when you realize them.

TransactionGain or Loss
Fund A sale$5,000 gain
Fund B sale$5,000 loss
Net capital gain$0

If capital losses exceed capital gains, taxpayers may be able to deduct a limited amount against ordinary income and carry forward unused losses, subject to rules.

Taxable Accounts vs. Retirement Accounts

Capital gains taxes usually matter most in taxable brokerage accounts. Inside tax-advantaged retirement accounts, such as 401(k)s and IRAs, buying and selling investments generally does not create current capital gains tax.

Account TypeCapital Gains Tax When Selling Inside Account?Notes
Taxable brokerageUsually yesGains, losses, dividends, and interest may matter yearly
Traditional IRAUsually no current capital gains taxWithdrawals generally taxed as ordinary income
Roth IRAUsually no current capital gains taxQualified withdrawals may be tax-free
401(k)Usually no current capital gains taxTax treatment depends on traditional or Roth account

This is one reason tax-advantaged accounts are powerful. They let investments grow without annual capital gains tax from normal trading inside the account.

Practical Capital Gains Planning

Capital gains planning is about making intentional choices, not avoiding all taxes. Sometimes selling is worth it even if tax is owed. A bad investment should not be held forever just to avoid tax. But tax awareness helps.

Useful habits include:

  • Know your cost basis before selling.
  • Check whether a holding is near long-term status.
  • Avoid unnecessary short-term trading in taxable accounts.
  • Use tax-advantaged accounts for frequent rebalancing when possible.
  • Consider capital losses when rebalancing taxable accounts.
  • Keep records for assets that may not have complete basis reporting.

Do not let taxes control every decision

If an investment no longer fits your plan, selling may be reasonable even with a tax bill. The goal is after-tax wealth and a sound portfolio, not simply minimizing taxes in one year.

Key Takeaways

  • Capital gains taxes apply when you sell an asset for more than your cost basis.
  • Short-term gains are generally taxed like ordinary income, while long-term gains may receive lower rates.
  • Selling after 13 months instead of 11 months can change tax treatment.
  • Capital losses can offset capital gains, reducing taxable gain.
  • Capital gains planning matters most in taxable brokerage accounts, not inside most retirement accounts.

Sign in to track your progress.

Up next · Module 2

Tax Strategy

This module focuses on legal strategies for reducing taxes and improving long-term wealth-building. Students learn how tax-advantaged accounts, tax-loss harvesting, and HSAs can make saving and investing more efficient.

Ask your AI guide

Finance Chat· Taxes & Tax Planning — Capital Gains Taxes
💰

Ask anything about Taxes & Tax Planning — Capital Gains Taxes, or choose a suggested question below.

Finance chat is for educational purposes only and does not constitute financial advice. Press Enter to send, Shift+Enter for new line.