How Capital Gains Tax Works on Investment Profits
Capital gains tax applies when you sell an investment for more than you paid. Learn how short-term vs. long-term rates differ, what triggers the tax, and how holding periods affect your bill.
One Day Can Cost Thousands
An investor who sells a stock held for 364 days pays federal tax at ordinary income rates — potentially 22%, 24%, 32%, 35%, or 37% depending on income bracket. The same investor who holds for one additional day — 365 days — qualifies for long-term capital gains rates of 0%, 15%, or 20%. On a $50,000 gain, the difference between a 32% short-term rate and a 15% long-term rate is $8,500 in federal tax. A single day in holding period translates directly into thousands of dollars. This is capital gains tax in its most concrete form.
A capital gain arises when an asset — a stock, bond, real estate property, mutual fund share, or other investment — is sold for more than its cost basis. The gain is the difference between the sale price and the adjusted cost basis. Cost basis typically equals the original purchase price, adjusted upward for any reinvested dividends and downward for any return-of-capital distributions. The gain is "realized" only upon sale; unrealized appreciation accumulates without triggering a tax event until the asset is sold.
Short-Term vs. Long-Term: The Holding Period Rule
The IRS distinguishes between two categories of capital gains based on the holding period. Assets held for one year or less (365 days or fewer) generate short-term capital gains, taxed at ordinary income rates — the same rates as wages and salary. Assets held for more than one year generate long-term capital gains, taxed at preferential rates.
| 2025 Tax Rates: Long-Term Capital Gains | Single Filer MAGI | Married Filing Jointly MAGI |
|---|---|---|
| 0% | Up to $48,350 | Up to $96,700 |
| 15% | $48,351–$533,400 | $96,701–$600,050 |
| 20% | Above $533,400 | Above $600,050 |
The 0% long-term capital gains bracket is a significant planning opportunity. A married couple filing jointly with taxable income — after deductions — below $96,700 pays no federal capital gains tax on long-term gains. Retirees strategically managing income can sometimes harvest years of investment gains entirely tax-free by timing recognition to low-income years.
Net Investment Income Tax (NIIT)
High-income investors face an additional 3.8% Net Investment Income Tax (NIIT) on investment income including capital gains. The NIIT applies to the lesser of net investment income or the amount by which MAGI exceeds $200,000 (single) or $250,000 (married filing jointly). This effectively creates a 23.8% maximum federal rate on long-term capital gains for high earners — 20% capital gains rate plus 3.8% NIIT.
- Effective maximum federal capital gains rates: 0%, 15%, 18.8%, 20%, or 23.8%
- Short-term gains can face rates up to 37% (plus 3.8% NIIT) for highest earners
- State income taxes add additional burden; California taxes capital gains as ordinary income at up to 13.3%
Cost Basis and Specific Identification
When an investor owns shares of the same security purchased at different prices and times, cost basis becomes a strategic variable. The IRS allows several methods for identifying which shares are sold:
| Method | Description | Tax Effect |
|---|---|---|
| FIFO (first in, first out) | Oldest shares sold first (default if not specified) | Often produces highest gains if shares appreciated over time |
| Specific identification | Investor designates exactly which shares are sold | Most flexible; can minimize gains or optimize holding period |
| Average cost | Average of all share purchase prices | Common for mutual funds; simple but inflexible |
| LIFO (last in, first out) | Most recently purchased shares sold first | Can minimize gains in rising markets |
Specific identification provides the most flexibility. An investor who purchased 100 shares at $20 (year one) and 100 shares at $80 (year three), who now wants to sell 100 shares at $90, can designate either batch. Selling the high-basis shares ($80 purchase) generates a $10 gain per share. Selling the low-basis shares ($20 purchase) generates a $70 gain per share. The choice has no effect on the portfolio's overall gain, but it determines the timing of tax recognition.
Special Capital Gains Situations
Certain asset categories receive distinct capital gains treatment. Real estate presents two notable rules. Under Section 121 of the Internal Revenue Code, homeowners may exclude up to $250,000 ($500,000 for married couples) of gain from the sale of a primary residence, provided they owned and used the home as their primary residence for at least two of the five years before the sale. Rental property gains — after depreciation recapture at a 25% rate — are also classified as long-term capital gains if the property was held over one year.
- Collectibles: Art, coins, antiques, and similar items face a maximum 28% long-term capital gains rate, not the standard 20%
- Qualified Small Business Stock (QSBS): Section 1202 allows exclusion of up to 100% of gains on eligible startup stock if held more than 5 years, subject to complex rules
- Inherited assets: Receive a "stepped-up" cost basis equal to fair market value at date of death — eliminating all unrealized gains accumulated during the decedent's lifetime
Capital Losses as an Offset
Capital losses — when an asset is sold for less than its cost basis — offset capital gains dollar for dollar. Net losses up to $3,000 per year can additionally offset ordinary income; losses beyond $3,000 carry forward to future tax years indefinitely. This mechanism is the foundation of tax-loss harvesting, a strategy of deliberately realizing losses to reduce the tax cost of gains recognized in the same year.
The wash-sale rule prevents abuse: an investor who sells a security at a loss and repurchases the same or "substantially identical" security within 30 days before or after the sale cannot claim the loss for tax purposes. The disallowed loss is added to the cost basis of the repurchased shares instead.
This article is for informational purposes only and does not constitute financial advice.
Related Articles
taxes
1099 Contractor Taxes: Quarterly Payments, Safe Harbor, and Schedule C
Independent contractors must pay estimated taxes quarterly and file Schedule C. Learn 2024 deadlines, safe harbor rules, 1099-NEC vs. 1099-MISC differences, and penalty avoidance.
9 min read
taxes
Bonus Depreciation 2024: 60% Rate, Phase-Down Schedule, and Qualified Property
Bonus depreciation drops to 60% in 2024, 40% in 2025, and 20% in 2026. Learn qualified property rules, anti-churning provisions, and how to plan around the phase-down.
9 min read
taxes
Capital Gains Tax Explained: Rates, Rules, and How to Minimize It
Understand how capital gains tax works, the difference between short-term and long-term rates, special rules for home sales, and legal strategies to reduce your bill.
9 min read
taxes
Charitable Giving and Taxes: Deductions, Donor-Advised Funds, and QCDs
Donating to charity can reduce your tax bill significantly — if you use the right strategies. Learn how charitable deductions work, how donor-advised funds amplify benefits, and what qualified charitable distributions offer retirees.
9 min read