Capital Gains Tax on Investments Explained: Short-Term vs Long-Term
Selling an investment for more than you paid creates a capital gain, and how long you held it decides the tax rate. This guide explains cost basis, short- and long-term rates, the net investment income tax, how losses offset gains, qualified dividends, and the forms the IRS expects.
When you sell a stock, fund or other investment for more than it cost, the profit is a capital gain, and the federal government taxes it. How much depends mainly on one fact: how long you owned the investment before selling. Gains on investments held more than a year get significantly lower rates than gains on investments held a year or less. Understanding that rule, and the few others around it, can change the after-tax result of the same trade.
The core idea: realized gains
Tax applies when a gain is realized, usually by selling. A stock that has doubled but has not been sold has an unrealized gain and no tax due. That gives investors control over timing, which is the root of most capital gains planning.
The gain is:
Sale proceeds − cost basis = capital gain (or loss)
Cost basis is generally what you paid, including commissions and fees, adjusted for events such as reinvested dividends (which add to basis) and certain corporate actions. Brokers track basis for most securities bought in recent years and report it to the IRS.
Two details often trip people up:
- Reinvested dividends buy new shares with their own basis. Forgetting them can lead to paying tax twice on the same money.
- Which shares you sell matters if you bought at different prices. Brokers default to a method such as first-in, first-out, but many let you pick specific lots, for example selling the highest-cost shares first to reduce the gain.
Short-term versus long-term
| Short-term | Long-term | |
|---|---|---|
| Holding period | One year or less | More than one year |
| Federal rate | Taxed as ordinary income at your regular bracket | 0%, 15% or 20%, depending on taxable income |
| Reported on | Form 8949 and Schedule D | Form 8949 and Schedule D |
The holding period generally starts the day after you buy and includes the day you sell. A sale exactly one year after purchase is still short-term; it must be more than a year.
The income thresholds for the 0%, 15% and 20% long-term rates are adjusted for inflation each year, and they vary by filing status. The IRS publishes the current thresholds in Topic No. 409 and the instructions for Schedule D. In broad terms, taxpayers with lower taxable income can pay 0% on long-term gains, most middle- and upper-middle-income investors pay 15%, and the 20% rate applies at the top of the income scale.
Because long-term gains stack on top of ordinary income when determining the rate, a large gain can push part of itself into a higher bracket. Spreading sales across tax years is one way investors manage this.
Exceptions to the standard rates
Not every long-term gain gets the 0/15/20% treatment:
- Collectibles, including art, coins and physical precious metals (and many funds that hold physical metal), face a maximum long-term rate of 28%.
- Unrecaptured Section 1250 gain from depreciated real estate is taxed at up to 25%.
- Section 1256 contracts, such as regulated futures, are taxed 60% long-term and 40% short-term regardless of holding period.
- Qualified small business stock can qualify for a partial or full exclusion of gain if detailed requirements are met.
The 3.8% net investment income tax
Higher-income taxpayers may owe an additional 3.8% net investment income tax (NIIT) on the lesser of their net investment income or the amount by which their modified adjusted gross income exceeds a threshold: $200,000 for single filers and $250,000 for married couples filing jointly. These thresholds are set in the law and are not indexed for inflation, so more taxpayers cross them over time. Capital gains, dividends, interest and rental income all count toward net investment income.
Dividends: qualified and ordinary
Dividends are not capital gains, but qualified dividends are taxed at the same 0/15/20% rates. To qualify, the dividend generally must come from a US corporation or a qualifying foreign one, and you must have held the stock for more than 60 days during the 121-day period that begins 60 days before the ex-dividend date. Dividends that do not qualify, including most distributions from REITs and money market funds, are taxed as ordinary income. Your Form 1099-DIV separates the two.
Funds also pay capital gain distributions when they sell holdings at a profit. These are taxed as long-term gains regardless of how long you have owned the fund.
How losses help
Capital losses offset capital gains. The netting works in steps: short-term losses offset short-term gains, long-term losses offset long-term gains, then any remaining net loss in one category offsets net gain in the other.
If losses exceed gains for the year, up to $3,000 of the net loss ($1,500 if married filing separately) can be deducted against ordinary income such as wages. Anything beyond that carries forward to future years indefinitely, keeping its short- or long-term character.
Deliberately selling losing positions to capture these benefits is called tax-loss harvesting, and it comes with its own rules, chiefly the wash-sale rule.
Gifts, inheritances and your home
- Inherited investments generally receive a basis equal to their fair market value on the date of death, often called a "step-up" in basis. Gains that built up during the original owner's lifetime are not taxed to the heir, and inherited property is treated as long-term regardless of how long the heir holds it.
- Gifted investments generally keep the giver's original basis, so the recipient inherits the built-in gain.
- A primary residence has its own exclusion for a large portion of the gain if ownership and use tests are met, covered in IRS Publication 523.
Reporting: the paperwork
Each year your broker sends Form 1099-B, listing sales, proceeds and, for covered securities, cost basis and holding period. Those figures flow onto Form 8949 and then Schedule D of Form 1040. When the broker reports basis to the IRS and no adjustments are needed, many transactions can be summarized directly on Schedule D. Keep purchase records for anything where basis is missing, such as old certificates or shares transferred from another firm.
Large gains realized during the year can also mean estimated tax payments are needed to avoid an underpayment penalty, since no tax is withheld on a sale.
Practical habits
- Check the purchase date before selling a position that is close to the one-year mark.
- Choose a lot-selection method deliberately rather than accepting the default.
- Hold investments that generate frequent taxable distributions inside tax-advantaged accounts where possible.
- Review realized gains and losses in the fall, while there is still time to act before December 31.
- Keep records of basis for anything not tracked by a broker.
This article explains how US federal capital gains tax works in general terms and is not tax advice. Rates, thresholds and rules change; check current IRS guidance and consult a tax professional about your own situation.
Frequently asked questions
Do I pay capital gains tax if I do not sell?
No. A gain is generally taxed only when it is realized by selling or otherwise disposing of the investment. However, mutual funds and some ETFs can distribute realized gains to shareholders, and those capital gain distributions are taxable in a taxable account even if you never sold a share.
Do capital gains in a 401(k) or IRA get taxed?
Not when they occur. Buying and selling inside a 401(k), traditional IRA or Roth IRA does not trigger capital gains tax. Traditional account withdrawals are taxed as ordinary income, and qualified Roth withdrawals are tax-free.
Do states tax capital gains too?
Most states with an income tax treat capital gains as ordinary income, and a few have special rules or no income tax at all. Your state's revenue department publishes how it treats gains.