When you sell an asset for more than you paid, the profit is a capital gain, and the IRS wants its share. How much you owe depends on how long you held the asset, your income and the type of asset. Understanding the rules can help you plan sales, avoid surprises and keep more of your profit. This guide explains how capital gains tax works for stocks, real estate and other investments.
What Counts as a Capital Gain?
A capital asset is almost anything you own for personal or investment purposes, including stocks, bonds, mutual funds, ETFs, real estate, cryptocurrency, collectibles and business interests. A capital gain is the difference between what you receive when you sell, called the amount realized, and your basis, which is generally what you paid plus certain costs such as commissions and improvements. If you sell for less than your basis, you have a capital loss.
Gains are only taxed when you sell, a point called realization. Unrealized gains on assets you still hold are not taxed in the current year.
Short-Term vs. Long-Term Gains
The holding period determines the tax treatment.
- Short-term capital gains. Assets held one year or less. Taxed at your ordinary income tax rates, which can be as high as 37 percent.
- Long-term capital gains. Assets held more than one year. Taxed at lower rates of 0, 15 or 20 percent for most assets.
Holding an investment for just over a year before selling can dramatically cut the tax rate.
Long-Term Capital Gains Rates
The rate depends on your taxable income and filing status. The brackets adjust for inflation each year, so check current thresholds at irs.gov.
| Rate | Who generally qualifies (approximate, varies by year) |
|---|---|
| 0% | Lower taxable income, roughly up to $49,000 single or $98,000 married filing jointly for recent years |
| 15% | Middle incomes, up to roughly $545,000 single or $613,000 joint |
| 20% | Highest incomes above those levels |
Higher earners may also owe the 3.8 percent Net Investment Income Tax on investment income when modified adjusted gross income exceeds $200,000 for single filers or $250,000 for joint filers.
Special Rates for Certain Assets
- Collectibles, such as art, antiques and precious metals, can be taxed at up to 28 percent.
- Unrecaptured Section 1250 gain from depreciation on real estate can be taxed at up to 25 percent.
- Qualified small business stock may qualify for special exclusions under certain conditions.
How Capital Losses Help
You can use capital losses to offset capital gains. If your losses exceed your gains, you can deduct up to $3,000 of the excess against ordinary income per year ($1,500 if married filing separately), and carry the remaining loss forward to future years. This is the basis of tax-loss harvesting, which means selling losing investments to offset gains. Beware of the wash sale rule, which disallows a loss if you buy the same or a substantially identical security within 30 days before or after the sale.
Selling Your Home
Selling a primary residence can be tax-advantaged. If you owned and lived in the home for at least two of the last five years, you can exclude up to $250,000 of gain, or $500,000 if married filing jointly. Gains above those amounts are taxable. Keep records of improvements, which raise your basis. Selling a second home or rental property does not qualify for the exclusion, and depreciation recapture may apply.
Stocks, Funds and Dividends
When you sell stock, your gain equals the sale price minus your basis. Mutual funds and ETFs may also distribute capital gains to shareholders each year, even if you did not sell. Index funds and many ETFs tend to be more tax-efficient than actively managed funds because they trade less. Compare these products in index funds vs. ETFs. Qualified dividends are taxed at long-term capital gains rates, while ordinary dividends are taxed as ordinary income.
Retirement Accounts Are Different
Gains inside a 401(k), traditional IRA or Roth IRA are not taxed each year. In traditional accounts, withdrawals are taxed as ordinary income. In Roth accounts, qualified withdrawals are tax-free. This is one reason to prioritize tax-advantaged accounts before taxable brokerage accounts. See 401(k) vs. Roth IRA to decide where to start.
Strategies to Reduce Capital Gains Tax
- Hold investments longer than a year to get long-term rates.
- Harvest losses to offset gains.
- Use tax-advantaged accounts for investing.
- Donate appreciated assets to charity instead of selling them. See standard deduction vs. itemizing for how donations can be deducted.
- Time sales in a lower-income year, such as early retirement, to qualify for lower rates.
- Choose specific lots when selling, to sell shares with higher basis first.
- Gift appreciated assets to family members in lower brackets, subject to gift tax rules and the kiddie tax.
- Spread out large sales across years.
Reporting Capital Gains
Brokers send Form 1099-B showing proceeds and often your basis. You report sales on Form 8949 and Schedule D, which flow into your Form 1040. Keep records of purchase dates, prices and improvements. For crypto and other digital assets, you must also report taxable transactions.
Common Mistakes
- Ignoring state capital gains tax. Many states tax gains, and a few do not.
- Forgetting reinvested dividends when computing basis.
- Triggering wash sales.
- Selling just before the one-year mark without considering the tax difference.
- Not planning for estimated tax payments after a big sale. If you owe a lot, review IRS payment plan options and plan ahead.
A Worked Example
Suppose you buy shares of an index fund for $10,000 and sell them 18 months later for $14,000. Your long-term gain is $4,000. If your taxable income puts you in the 15 percent long-term bracket, you owe about $600 in federal tax. Had you sold after ten months, the $4,000 would be a short-term gain taxed at your ordinary rate, perhaps 22 percent, or $880. That difference of $280 illustrates why holding periods matter. State taxes may apply on top of the federal amount.
Keep Good Records
Save trade confirmations, annual brokerage statements and records of improvements to real estate. If you inherited an asset, document the date-of-death value. For assets bought in several lots, note which lots you sell, since the basis can differ. Good records can save you real money and make filing much easier.
Frequently Asked Questions
Do I pay capital gains tax if I reinvest the proceeds?
Generally yes. Reinvesting does not defer tax, except in special arrangements such as certain like-kind exchanges of real estate.
Are gifts and inheritances taxed as capital gains?
Gifts carry over the giver’s basis. Inherited assets generally get a stepped-up basis to the market value at death, which can reduce gains.
How are crypto gains taxed?
Digital assets are treated as property, so sales and many exchanges can trigger capital gains.
Do I owe tax if I sell at a loss?
No, and losses can offset gains and up to $3,000 of other income.
Bottom Line
Capital gains tax rewards patience and planning. Holding for more than a year, using tax-advantaged accounts, harvesting losses and understanding the home sale exclusion can substantially cut what you owe.
Related guides
- IRS Payment Plans: What to Do If You Can’t Pay Your Tax Bill
- The Child Tax Credit Explained: Who Qualifies and How Much
- How Much Should You Save for Retirement at Every Age?
- Small Business Loans: Types, Requirements and How to Apply
This article is for general education only and is not financial, tax, legal or insurance advice. Rates, limits and rules change, so confirm current details with the provider or a licensed professional before you decide.
