Tax
Capital Gains Tax Explained 2026
Selling an investment for a profit triggers a tax most people do not understand until the bill arrives. Here is how capital gains tax actually works.
Capital gains tax is the tax you pay when you sell an asset, such as a stock, a fund, or a property, for more than you paid for it, and it is one of the most misunderstood taxes in personal finance, because the rate you pay depends on how long you held the asset, how much other income you have, and which kind of gain it is. The difference between getting it right and getting it wrong can be thousands of dollars on a single sale, and the difference between short-term and long-term treatment is often larger than the difference between a good investment and a bad one.
This guide explains how capital gains are calculated, what the short-term and long-term rates are, how losses offset gains, and the legal strategies investors use to reduce the bill, from tax-loss harvesting to holding periods to retirement accounts. It is general education, not tax advice for your specific situation, and the current thresholds change with the tax year, so the official figures should always be checked. The IRS website publishes the current capital gains rates and thresholds, and its tax topic on capital gains is the authoritative reference for the numbers in this guide.
1. What counts as a capital gain, and how it is calculated
A capital gain is the difference between what you sold an asset for and what you paid for it, adjusted for costs: the sale price minus the purchase price, minus selling costs such as commissions, and plus any improvements you made to the asset in the case of property. If you bought shares for two thousand dollars and sold them for three thousand, your capital gain is one thousand dollars, and that is the amount that is taxed, not the full three thousand, a distinction that surprises many first-time sellers.
The holding period decides the tax treatment: an asset held for one year or less produces a short-term gain, taxed at your ordinary income tax rate, while an asset held for more than one year produces a long-term gain, taxed at the preferential long-term rates. The one-year line is a cliff, not a slope, so selling on day 364 and selling on day 366 can produce very different tax bills on the same profit, which is why the holding period deserves a check before every sale. Keep records of purchase dates and prices for every investment, because your brokerage reports them, but the records are your responsibility if the brokerage's figures are wrong, and the tax-loss harvesting guide explains how losses interact with gains once you have them.
2. The long-term rates: zero, fifteen, and twenty percent
Long-term capital gains are taxed at zero, fifteen, or twenty percent depending on your taxable income and filing status, with an additional net investment income tax of 3.8 percent applying above higher income thresholds. The zero percent rate means that many lower- and middle-income investors pay no federal tax at all on long-term gains, which is one of the most valuable features of the tax code for ordinary savers, and it is the reason holding investments for more than a year is usually worth it even when a short-term sale looks tempting.
The exact income thresholds for each rate change every year with inflation, so a threshold quoted in an article can be out of date within months, and the reliable source is the IRS's current-year figures, published on IRS Tax Topic 409 on capital gains and losses. State taxes are a separate matter: most states tax capital gains as ordinary income, so the total bill on a sale is the federal rate plus your state rate, and a few states have no income tax at all, which makes the state you live in part of the calculation. The practical lesson is simple: before selling a large holding, look up the current thresholds for your filing status, work out which rate applies, and compare the after-tax result of selling now against selling later.
3. Short-term gains and why they cost more
Short-term gains are taxed as ordinary income, which means they are added to your salary, your business income, and everything else, and taxed at your marginal income tax rate, which for many investors is twenty-two or twenty-four percent, and for higher earners can be thirty-two percent or more. That is a large premium over the fifteen percent long-term rate, and it is the main reason frequent trading is expensive even when the trades themselves are profitable: a trader who buys and sells within months keeps far less of each gain than an investor who holds for years.
The math is worth doing on a real example: a ten thousand dollar gain taxed at fifteen percent costs one thousand five hundred dollars, while the same gain taxed at twenty-four percent costs two thousand four hundred, a difference of nine hundred dollars on a single trade, and a trader making several such trades a year can easily lose thousands to the short-term premium alone. This does not mean you should never sell within a year, because sometimes the investment case changes and selling is right regardless of tax, but it does mean the tax cost should be part of the decision, not discovered afterwards. The dollar-cost averaging guide covers a buying strategy that naturally produces long-term holdings, and the investing mistakes guide lists the other costs that quietly eat returns.

4. Losses offset gains, and the three thousand dollar rule
Capital losses are the silver lining of a bad investment, because they offset capital gains dollar for dollar: if you made five thousand dollars on one sale and lost three thousand on another in the same year, you only pay tax on the net two thousand. Losses are applied to gains of the same type first, short-term losses against short-term gains and long-term against long-term, and then any remaining loss crosses over to the other type, which means the order of your sales within a year can change the bill.
If your total losses exceed your total gains, you can deduct up to three thousand dollars of the excess against your ordinary income each year, or fifteen hundred if you are married filing separately, and any remaining loss carries forward to future years indefinitely, which means a large loss in one year can shelter gains for years afterwards. The wash-sale rule limits the game: if you sell a security at a loss and buy the same or a substantially identical security within thirty days before or after the sale, the loss is disallowed for tax purposes, so investors who want the loss usually buy a similar but not identical fund instead. Check the current rules on the IRS website, because the wash-sale rule and the loss limits are among the most commonly misunderstood parts of the code.
5. Legal ways to reduce the capital gains bill
The most powerful way to reduce capital gains tax is to hold investments in a tax-advantaged account: gains inside a 401(k), a traditional IRA, or a Roth IRA are not taxed when the investment is sold, and in a Roth IRA qualified withdrawals are tax-free altogether, which means the entire capital gains question disappears for money held in these accounts. That is why the order of operations for most investors is to fill the tax-advantaged accounts first and only then invest in a taxable brokerage account, where gains are taxed as they are realised.
Other legal strategies include tax-loss harvesting, which means deliberately realising losses to offset gains, and which is most valuable in years when you have large gains; timing sales into a lower-income year, such as a year between jobs or early in retirement before Social Security and required distributions begin; and donating appreciated shares to charity, which lets you deduct the fair market value while skipping the capital gains tax entirely. Gifting appreciated shares to a family member in a lower tax bracket can also shift the gain, although the kiddie tax rules limit this for children. The year-end tax planning checklist covers the timing strategies in detail, and the freelancer deductions guide covers the deduction side of the same picture.
6. The home sale exclusion and other special cases
The most valuable capital gains exclusion in the tax code has nothing to do with stocks: if you sell your primary home, you can exclude up to two hundred and fifty thousand dollars of gain if you are single, or five hundred thousand if married filing jointly, provided you owned and lived in the home for at least two of the five years before the sale. This exclusion can be used repeatedly, once every two years, and it means most homeowners pay no capital gains tax at all on their home, which is a large part of why a primary residence is such a powerful wealth-building asset.
Other special cases include collectibles, which are taxed at a higher maximum rate of twenty-eight percent, and inherited assets, which generally receive a stepped-up basis to their value at the date of death, meaning the heir's gain is measured from the inherited value rather than the original purchase price, which can eliminate a large tax bill entirely. Depreciation recapture applies to rental property, where the portion of the gain attributable to depreciation claimed over the years is taxed at up to twenty-five percent, and a 1031 exchange allows the gain on an investment property to be deferred by rolling it into a similar property, subject to strict rules and deadlines. These cases are where professional advice earns its fee, because the rules are detailed and the amounts are large, and a mistake can cost far more than the cost of an hour with a tax professional. The rent versus buy guide covers the home ownership side of the picture.

The verdict: hold longer, harvest losses, shelter what you can
Capital gains tax rewards patience and planning: long-term gains are taxed at zero, fifteen, or twenty percent, short-term gains at your ordinary rate, losses offset gains dollar for dollar with three thousand dollars deductible against ordinary income, and the most powerful shelter of all is a tax-advantaged account where the question never arises. Check the holding period before every sale, and check the current IRS thresholds before a large one.
Start this year: review your taxable account for losing positions you could harvest against gains, and move future investing into tax-advantaged accounts first. The tax you do not pay is a return no investment can match.
Frequently asked questions
A short-term gain comes from an asset held one year or less and is taxed at your ordinary income rate. A long-term gain comes from an asset held more than one year and is taxed at zero, fifteen, or twenty percent depending on your income.
Long-term gains on stocks are taxed at zero, fifteen, or twenty percent depending on taxable income and filing status, plus a possible 3.8 percent net investment income tax at higher incomes. Short-term gains are taxed as ordinary income.
Yes. Losses offset gains dollar for dollar, and if losses exceed gains you can deduct up to three thousand dollars of the excess against ordinary income each year, carrying any remainder forward to future years.
If you sell a security at a loss and buy the same or a substantially identical security within thirty days before or after the sale, the IRS disallows the loss. Investors usually buy a similar but not identical fund to stay invested while keeping the loss.
Usually not. If you owned and lived in your primary home for at least two of the five years before the sale, you can exclude up to $250,000 of gain if single or $500,000 if married filing jointly.
Keep reading
- Tax-Loss Harvesting Explained for Beginners
- Year-End Tax Planning Checklist 2026
- IRA & HSA Contribution Limits 2026
- Dollar-Cost Averaging Explained
Affiliate disclosure: Some links in this article are affiliate links. If you buy through them, MoneyWise may earn a commission at no extra cost to you. We participate in the Amazon Associates Program (as an Amazon Associate, we earn from qualifying purchases) and the AliExpress Affiliate Program. Details on this page can change — always check the official provider page before buying. Content on this site is educational only and is not financial advice.