Capital Gains Tax Explained: How Short-Term and Long-Term Gains Are Taxed
What Are Capital Gains and Why Do They Matter?
When you sell something for more than you paid for it, the profit is called a capital gain. Sell a stock, a piece of real estate, a cryptocurrency, or even a collectible for more than your purchase price, and the IRS wants a cut. That cut is the capital gains tax — and how much you owe depends on how long you held the asset, your income level, and what type of asset you sold.
Capital gains tax affects far more people than realize it. If you've ever sold stock from a brokerage account, cashed out crypto, or sold a home for a profit, you've dealt with capital gains. And the difference between a short-term gain and a long-term gain can mean paying anywhere from 10% to 37% versus 0% to 20% on the same dollar amount. Getting this right matters.
This guide breaks down how capital gains tax works, walks through real examples with actual numbers, and covers strategies that can legally reduce your tax bill. Whether you sold a single stock or you're planning a home sale, you'll know exactly what to expect and what to do next.
Short-Term vs. Long-Term Capital Gains: The Key Distinction
The single most important factor in how your capital gains get taxed is how long you held the asset before selling. The IRS draws a bright line at one year:
Short-term capital gain: You held the asset for one year or less. These gains are taxed at your ordinary income tax rate — the same rates that apply to your salary, bonuses, and interest income.
Long-term capital gain: You held the asset for more than one year. These gains qualify for preferential tax rates that are significantly lower than ordinary income rates.
The holding period starts the day after you acquire the asset and ends on the day you sell it. So if you buy a stock on January 1, 2025, your holding period begins January 2, 2025. Sell on January 1, 2026, and it's short-term (held exactly one year). Sell on January 2, 2026, and it's long-term (held more than one year). That one extra day can save you thousands.
Why This Matters: A Real Example
Let's say you're a single filer with $100,000 in ordinary income and you sell a stock for a $20,000 profit.
If you held the stock for 10 months (short-term gain): That $20,000 gets added to your ordinary income, putting you in the 24% federal bracket. You'd owe roughly $4,800 in federal tax on the gain.
If you held the stock for 14 months (long-term gain): That $20,000 qualifies for the 15% long-term capital gains rate. You'd owe $3,000 in federal tax on the same gain.
The difference: $1,800 — just for waiting a few more months before selling. On larger gains, the savings get dramatic fast.
2026 Capital Gains Tax Rates
Long-term capital gains tax rates are tied to your taxable income (not just your capital gains). For 2026, the three brackets are:
| Filing Status | 0% Rate | 15% Rate | 20% Rate |
|---|---|---|---|
| Single | Up to $48,350 | $48,351 – $533,400 | Over $533,400 |
| Married Filing Jointly | Up to $96,700 | $96,701 – $600,050 | Over $600,050 |
| Married Filing Separately | Up to $48,350 | $48,351 – $300,025 | Over $300,025 |
| Head of Household | Up to $64,750 | $64,751 – $566,700 | Over $566,700 |
These thresholds are based on your total taxable income — ordinary income plus net capital gains. If your total taxable income is $40,000 and you have a $5,000 long-term capital gain, that gain falls in the 0% bracket and you owe zero federal tax on it. That's not a loophole — it's by design, and it's one of the most powerful tools for low- and middle-income investors.
Short-term capital gains, by contrast, are simply added to your ordinary income and taxed at your marginal rate. For 2026, the federal ordinary income brackets range from 10% to 37%.
The Net Investment Income Tax (NIIT)
There's an additional 3.8% surtax that applies to investment income — including capital gains — for taxpayers with modified adjusted gross income above $200,000 (single) or $250,000 (married filing jointly). This is the Net Investment Income Tax, and it stacks on top of the regular capital gains rate. So if you're in the 20% long-term bracket and subject to the NIIT, your effective rate on capital gains becomes 23.8%.
The NIIT isn't a fringe concern. If you're a high earner with significant investment income, it adds up. According to the IRS Topic No. 559, the surtax applies to the lesser of your net investment income or the amount by which your MAGI exceeds the threshold.
How Different Assets Are Taxed
Not all capital gains are created equal. The type of asset you sell affects how the gain is calculated and taxed.
Stocks, Bonds, and ETFs
These are the most common capital gains assets. Your gain is the sale price minus your cost basis (what you paid plus any commissions). If you bought shares at different times and prices, you can choose which shares to sell using specific identification, FIFO (first in, first out), or average cost — and your choice directly affects your tax bill.
Specific identification gives you the most control. Say you bought 100 shares at $50 and 100 shares at $80. If you sell 100 shares, you can choose to sell the $80 shares (smaller gain or even a loss) or the $50 shares (larger gain). Most brokerages let you select this method at the time of sale.
Real Estate and Your Home
Selling your primary residence has a special exemption that can wipe out a significant amount of capital gains tax. If you've owned and lived in the home for at least two of the five years before selling, you can exclude up to $250,000 of gain (single) or $500,000 of gain (married filing jointly) from taxation entirely.
This exclusion is per person, not per property. A married couple can exclude $500,000 every two years as long as they meet the ownership and use tests. You can even use it multiple times over your lifetime — there's no one-time limit, just the two-year waiting period between uses.
For investment property, there's no such exclusion. But you can use a 1031 exchange to defer the gain by rolling the proceeds into another investment property. This is a powerful strategy for real estate investors, though the rules are strict and the timeline is tight: 45 days to identify a replacement property and 180 days to close.
Cryptocurrency
The IRS treats cryptocurrency as property for tax purposes, which means every sale, trade, or use of crypto to purchase something is a taxable event. Convert Bitcoin to Ethereum? Taxable. Buy a coffee with Bitcoin? Taxable. The gain or loss is calculated the same way as stocks — proceeds minus cost basis.
Crypto presents unique challenges for tracking cost basis because many people make dozens or hundreds of small transactions across multiple platforms. If you can't establish your cost basis, the IRS assumes a basis of zero — meaning you'd owe tax on the entire sale amount, not just the gain. Good record-keeping is essential.
Collectibles
Art, antiques, coins, precious metals, and other collectibles held for more than one year are taxed at a maximum rate of 28% instead of the standard 20%. Short-term collectible gains are still taxed at ordinary rates. This higher rate makes collectibles less tax-efficient than stocks for long-term investors.
Qualified Small Business Stock (QSBS)
If you hold qualified small business stock for more than five years, you may be able to exclude up to $10 million (or 10x your cost basis, whichever is greater) of the gain from federal tax under Section 1202. This is one of the most generous exemptions in the tax code, but the requirements are strict: the company must be a C corporation with gross assets under $50 million when you acquire the stock, and you must hold it for at least five years.
Calculating Your Capital Gains: Step by Step
Figuring out your capital gains tax isn't just about multiplying your gain by a rate. The calculation involves several steps, and getting any of them wrong can cost you money.
Step 1: Determine Your Cost Basis
Your cost basis is generally what you paid for the asset, including commissions and fees. But it gets more complex:
Stock splits: If you bought 100 shares at $100 each ($10,000 total) and the stock does a 2-for-1 split, you now own 200 shares with a cost basis of $50 each. Your total basis hasn't changed — it's still $10,000 — but your per-share basis has.
Dividend reinvestment (DRIP): Each reinvested dividend creates a new tax lot with its own cost basis. If you've been reinvesting dividends for years, you may have dozens of tax lots for a single stock, each with a different basis and holding period.
Inherited assets: These get a "step-up" in basis to the fair market value on the date of the original owner's death. If your grandmother bought stock for $1,000 and it was worth $50,000 when she died, your basis becomes $50,000. Sell it the next day and you owe zero capital gains tax. This is one of the biggest tax advantages in the code — and it's why holding appreciated assets until death is a common estate planning strategy.
Gifted assets: Unlike inherited assets, gifted assets carry over the original owner's cost basis. If your mother gifts you stock she bought for $5,000 that's now worth $50,000, your basis is $5,000 — not $50,000. You'd owe tax on a $45,000 gain if you sold.
Step 2: Calculate Your Gain or Loss
Gain or loss = Sale price minus cost basis. Simple in concept, but tracking cost basis across multiple purchases, reinvestments, and stock splits requires good records or a brokerage that tracks it for you.
Since 2011, brokerages have been required to track and report cost basis for covered securities (stocks and ETFs purchased after that date). Your 1099-B will show your basis, but it's worth verifying — brokerage errors happen, and you're responsible for the accuracy of your return.
Step 3: Net Your Gains and Losses
This is where things get strategic. The IRS requires you to net your gains and losses in a specific order:
- Net short-term gains against short-term losses
- Net long-term gains against long-term losses
- Net the results against each other
If you end up with a net short-term gain and a net long-term gain, they're taxed at their respective rates. But if you have a net loss in either category, it offsets the other category first. And if your total net losses exceed your total net gains, you can deduct up to $3,000 ($1,500 if married filing separately) against ordinary income per year, carrying forward any remainder to future years.
Strategies to Reduce Your Capital Gains Tax
Now that you understand how capital gains tax works, here are proven strategies to legally reduce what you owe.
Tax-Loss Harvesting
This is the single most powerful tool for managing capital gains tax. Tax-loss harvesting means selling investments that have lost value to realize the loss, then using that loss to offset gains elsewhere in your portfolio.
Say you have $10,000 in long-term gains from selling Apple stock, but you're also holding $10,000 in unrealized losses on another position. By selling the losing position, you can offset the entire Apple gain and owe zero capital gains tax.
There's a catch: the wash sale rule. If you buy a "substantially identical" security within 30 days before or after the sale, the IRS disallows the loss. You can't sell a stock at a loss and immediately buy it back just to capture the tax benefit. But you can buy a similar (not identical) fund — for example, selling a Vanguard S&P 500 fund and buying a Fidelity S&P 500 fund — though the IRS hasn't definitively ruled on whether this triggers the wash sale rule. The safest approach is to buy a different index or wait 31 days.
Our complete guide to tax-loss harvesting covers this strategy in much more detail, including how to harvest losses throughout the year and avoid common mistakes.
Hold for More Than One Year
This is the simplest strategy and the one most people overlook. If you're sitting on a gain and the one-year mark is approaching, waiting even a few extra days can cut your tax rate in half or more.
Going from a 32% short-term rate to a 15% long-term rate on a $50,000 gain saves you $8,500. That's not trivial — it's real money that stays in your account instead of going to the IRS. Always check your holding period before selling.
Strategic Charitable Giving
Donating appreciated stock to charity is a double tax benefit. You avoid paying capital gains tax on the appreciated amount, and you get a charitable deduction for the full fair market value of the stock. The charity pays no tax either, since it's a tax-exempt organization. Everyone wins except the IRS.
This only works with long-term holdings. Donating a stock you've held for one year or less only lets you deduct your cost basis, not the appreciated value.
Offset Gains with Losses Before Year-End
December is the time to review your portfolio for tax-loss harvesting opportunities. Look for positions with unrealized losses that you wouldn't mind selling. Realize those losses before December 31 to offset gains you've already realized this year.
Be mindful of the wash sale rule if you plan to repurchase the same security. And don't let tax considerations override sound investment decisions — selling a position purely for the tax loss only makes sense if you wouldn't want to hold it anyway.
Use the 0% Bracket Strategically
If your taxable income falls in the 0% long-term capital gains bracket, you can realize gains without paying any federal tax on them. This is sometimes called "gain harvesting" — intentionally selling and repurchasing assets to reset your cost basis higher while paying zero tax.
For example, if you're a single filer with $35,000 in ordinary income and $10,000 in unrealized long-term gains, you could sell those assets, pay 0% federal tax on the gain, and repurchase immediately to establish a higher cost basis. There's no wash sale rule for gains — only for losses.
This strategy is particularly powerful in years when your income is unusually low: between jobs, during a sabbatical, or in early retirement before Social Security and required minimum distributions begin. Use our tax-efficient investing guide to plan around these opportunities.
Consider Asset Location
Where you hold an asset matters almost as much as what you hold. Assets that generate ordinary income (bonds, REITs) are better held in tax-advantaged accounts like IRAs and 401(k)s. Assets that generate long-term capital gains (index funds, growth stocks) are better held in taxable accounts, where they benefit from the preferential rates.
This concept — asset location — can save you tens of thousands of dollars over a lifetime. Our asset location calculator helps you visualize the difference based on your specific portfolio and tax situation.
Capital Gains on Your Home Sale
Home sales deserve special attention because the rules are favorable and commonly misunderstood. If you're selling your primary residence, the $250,000/$500,000 exclusion is one of the biggest tax breaks available to ordinary homeowners.
Qualifying for the Exclusion
To claim the home sale exclusion, you must meet both tests:
Ownership test: You must have owned the home for at least two of the five years before the sale.
Use test: You must have lived in the home as your primary residence for at least two of the five years before the sale.
The two years don't need to be consecutive. You could live in the home for 18 months, rent it out for two years, move back for six months, and still qualify. But the periods of use must total at least 730 days within the five-year window.
Partial Exclusions
If you don't meet the two-year tests but you're selling because of a change in employment, health reasons, or an unforeseen circumstance (divorce, natural disaster, military orders), you may qualify for a prorated exclusion. The IRS calculates it based on the fraction of the two-year period you satisfied.
Calculating the Gain on Your Home
Your capital gain on a home sale is the sale price minus your cost basis minus selling costs. Your cost basis includes what you paid for the home plus the cost of any capital improvements (additions, new roof, renovated kitchen) — but not routine maintenance or repairs. Selling costs include real estate agent commissions, title insurance, transfer taxes, and staging fees.
For a deeper walkthrough, see our capital gains tax on home sales guide, which covers exclusions, calculations, and common mistakes in detail.
What Happens If You Have Capital Losses
Capital losses aren't fun, but they're not wasted. The tax code lets you use losses to reduce your tax burden in several ways:
Offset gains: Losses offset gains dollar for dollar. Short-term losses offset short-term gains first; long-term losses offset long-term gains first. Any remaining losses then offset the other type of gain.
Deduct against ordinary income: If your total net losses exceed your total net gains, you can deduct up to $3,000 per year against ordinary income ($1,500 if married filing separately). This reduces your taxable income directly.
Carry forward indefinitely: Any losses you can't use this year carry forward to future years. There's no expiration date. If you have $30,000 in net losses this year, you can deduct $3,000 per year for the next ten years — or offset future gains in full whenever they occur.
This is why some investors deliberately harvest losses in down markets. The losses provide tax benefits now and in the future, while the market is likely to recover over time.
Common Mistakes People Make with Capital Gains
Even experienced investors make these errors. Knowing about them ahead of time can save you real money.
Not tracking cost basis. If you can't prove what you paid for an asset, the IRS assumes your basis is zero. That means the entire sale price is treated as gain. Keep records of every purchase, reinvestment, and stock split — or make sure your brokerage is tracking it accurately.
Selling too soon. The difference between holding an asset for 364 days and 366 days can be thousands of dollars in taxes. Always check your purchase date before selling a profitable position.
Ignoring state taxes. Most states tax capital gains as ordinary income. California, for example, adds up to 13.3% on top of the federal rate. A few states — Alaska, Florida, Nevada, New Hampshire, South Dakota, Tennessee, Texas, Washington, and Wyoming — have no state income tax, which means no state capital gains tax either.
Forgetting about mutual fund distributions. Even if you didn't sell any shares, mutual funds can distribute capital gains to you at the end of the year. These distributions are taxable. Check your fund's distribution schedule and factor it into your year-end tax planning.
Not using tax-loss harvesting proactively. Many investors only think about losses at tax time. But harvesting losses throughout the year — especially during market dips — gives you more flexibility at year-end and prevents the December rush.
Overlooking the NIIT surcharge. If your income is near the $200,000/$250,000 threshold, realizing a large gain could push you over it and trigger the 3.8% NIIT on top of your regular capital gains rate. Sometimes it makes sense to spread gains across two tax years.
Reporting Capital Gains on Your Tax Return
Capital gains and losses are reported on IRS Schedule D (Form 1040), which feeds into your main tax return. Here's what you need to know:
Form 1099-B: Your brokerage sends this form by mid-February, reporting the proceeds from all your sales during the year. For covered securities (most stocks and ETFs purchased after 2011), the form includes your cost basis and whether the gain is short-term or long-term.
Form 8949: This is where you list each individual sale — description of the asset, date acquired, date sold, proceeds, cost basis, and gain or loss. The totals from Form 8949 flow to Schedule D.
Virtual currency: If you sold cryptocurrency, you report it on Form 8949 just like stocks. The IRS has been increasing enforcement on crypto reporting, and many exchanges now issue 1099 forms. But you're responsible for accurate reporting regardless of whether you receive a form.
If your capital gains situation is complex — multiple lots, inherited assets, home sales, crypto transactions — consider using tax preparation software or working with a tax professional. The cost of professional help is often far less than the cost of mistakes or missed deductions.
Planning Ahead: A Year-Round Framework
Capital gains tax isn't something you deal with only in April. Smart tax planning happens throughout the year:
Q1 (January–March): Review last year's realized gains and losses. Did you harvest enough losses? Did you trigger any wash sales? File your return early if you're due a refund.
Q2 (April–June): Review your portfolio for positions approaching the one-year holding mark. Plan sales around the long-term threshold. Consider charitable giving of appreciated stock if you're so inclined.
Q3 (July–September): Mid-year tax projection. Estimate your total income for the year, including expected gains and losses. If you're near the 0% bracket ceiling, plan gain harvesting accordingly. Use our strategies to reduce taxable income if you're close to a bracket threshold.
Q4 (October–December): The critical period. Harvest any remaining losses. Decide whether to realize gains this year or defer to next. Check for mutual fund distributions. Max out tax-advantaged accounts. If you're considering selling a highly appreciated position, run the numbers through our tax-efficient investing guide first.
You Might Also Enjoy
Want to go deeper on related topics? These PocketWise guides and calculators can help:
- Tax-Loss Harvesting Guide — A deep dive into the strategy of selling losing investments to offset gains, including wash sale rules and year-end tactics.
- Tax-Efficient Investing — How to structure your portfolio across taxable and tax-advantaged accounts to minimize taxes over time.
- How to Reduce Taxable Income — Practical strategies for lowering your tax bill, from deductions and credits to timing income and losses.
- Capital Gains Tax on Home Sales — Everything about the $250,000/$500,000 home sale exclusion, qualifying rules, and calculations.
- Compound Interest Calculator — See how holding investments longer doesn't just grow your money — it also qualifies you for lower tax rates on the gains.