Capital gains tax is the federal tax you owe on the profit from selling an asset for more than you paid for it. That asset could be a stock, a mutual fund, a rental property, a cryptocurrency, or even a collectible. Because the IRS treats investment profit differently from your paycheck, understanding the rules can meaningfully change how much you keep after a sale. This guide walks through how capital gains are calculated, how the short-term and long-term rates differ, and the planning moves that help long-term investors reduce their tax bill.
What Counts as a Capital Gain?
A capital gain is the difference between your basis in an asset and its selling price. Basis usually starts as what you paid, but it can be adjusted upward for things like reinvested dividends, commissions, or capital improvements to a property. If you sell for less than your basis, you have a capital loss, which can offset gains and, to a limited degree, ordinary income.
The holding period is the single most important variable. The IRS draws the line at one year:
- Short-term gains apply to assets held one year or less. They are taxed as ordinary income, at rates from 10% to 37% depending on your bracket.
- Long-term gains apply to assets held more than one year. They qualify for preferential rates of 0%, 15%, or 20%, depending on taxable income.
That distinction is why patient investors often pay far less tax than active traders on the same dollar of profit. Selling a stock after 366 days instead of 300 can cut your rate on that gain from 24% or more down to 15%.
How the Long-Term Capital Gains Brackets Work
Long-term capital gains are stacked on top of your ordinary income, then taxed in layers. For tax year 2025, the 0% bracket applies to taxable income up to $48,350 for single filers and $96,700 for married couples filing jointly. The 15% bracket extends to $533,400 single and $600,050 joint. Gains above those thresholds face 20%.
Because the brackets are progressive, a large gain does not push all your gains into a higher rate; only the portion above each threshold is taxed at the next rate. A married couple with $80,000 of ordinary income and a $40,000 long-term gain, for example, would pay 0% on the portion of the gain that fits under $96,700 and 15% on the rest.
Two additional layers can apply:
- The 3.8% net investment income tax on investment income above $200,000 single or $250,000 joint.
- Higher Medicare Part B and D premiums triggered by income reported on your return, which effectively acts as a surtax on large gains.
Netting Gains and Losses: The Rules That Save Money
You do not report each trade in isolation. On Schedule D, you net short-term gains against short-term losses, and long-term gains against long-term losses. If one category ends in a loss, it can offset gains in the other. Up to $3,000 of remaining net loss can reduce ordinary income each year, and any excess carries forward indefinitely.
This creates a useful planning tool called tax-loss harvesting: selling a losing position to offset realized gains elsewhere. Be aware of the wash-sale rule, which disallows the loss if you buy a substantially identical security within 30 days before or after the sale. That window includes purchases in an IRA, so coordinate across all your accounts.
Strategies to Manage Capital Gains Tax
Taxes should rarely drive an investment decision, but they should shape how you execute one. Consider these approaches:
- Hold past the one-year mark when the investment thesis still holds. The rate difference is often larger than any short-term price move.
- Use tax-advantaged accounts strategically. Hold high-turnover funds in IRAs and 401(k)s, and keep tax-efficient index funds in taxable brokerage accounts.
- Harvest losses in down markets to bank deductions you can use against future gains.
- Consider charitable giving. Donating appreciated shares held more than a year lets you deduct fair market value while avoiding the gain entirely.
- Watch the 0% bracket. Retirees with low ordinary income can realize gains at 0% and even do Roth conversions in the same window, though each strategy affects the other.
- Plan step-up in basis. Assets held until death generally receive a new basis equal to fair market value, erasing unrealized gains for heirs.
Special rules also apply to primary residences, where up to $250,000 of gain ($500,000 for joint filers) can be excluded if you meet the ownership and use tests, and to collectibles and qualified small business stock, which have their own rates and exclusions.
What to Remember
Capital gains tax rewards patience and planning. The core mechanics are simple: measure profit against your basis, classify the holding period, and apply the correct rate to the layered amount. The complexity lives in the details, from netting rules and wash sales to the interaction between gains and income-based surcharges. Before any significant sale, estimate the tax impact, check whether waiting a few weeks changes the rate, and coordinate with your broader retirement and income plan. A few deliberate decisions can preserve a meaningful share of your investment returns over a lifetime.








