Capital Gains Tax Explained: Short-Term vs Long-Term (With Real Examples)
Understand capital gains tax rates, the difference between short-term and long-term gains, and legal strategies to minimize what you owe when selling investments.
Nadia Park is 41 years old, a software engineer in Portland, Oregon, earning $135,000 per year. In November 2024, she sold some stock she'd bought through her company's ESPP program — shares she'd held for 11 months. She made $18,400 on the sale. She was thrilled. Then she did her taxes in March and owed $5,152 more than she expected. If she'd waited just 31 more days to sell, she would have owed $2,760 instead. The difference: $2,392. The reason: she sold 11 months in and the threshold for the lower tax rate requires 12 months. Capital gains tax has two completely different rates, and the line between them is exactly one year.
What Capital Gains Tax Is
When you sell an asset — a stock, bond, mutual fund, real estate, cryptocurrency, or other investment — for more than you paid for it, the profit is called a capital gain. The IRS taxes that gain. The amount of tax you owe depends almost entirely on one factor: how long you held the asset before selling.
This is the fundamental concept that every investor needs to internalize. Capital gains aren't taxed at your regular income rate — at least not always. The tax code explicitly rewards patience by taxing gains on assets held longer than a year at significantly lower rates. The IRS is incentivizing long-term investment, and the difference in dollars is substantial enough that the holding period is one of the most important investment decisions you make.
Short-Term Capital Gains: The Expensive Ones
If you sell an asset within 12 months of buying it, any profit is a short-term capital gain. Short-term gains are taxed as ordinary income — meaning they're added to your other income and taxed at your marginal federal tax bracket. The same rates that apply to your salary apply here.
For 2025, the federal income tax brackets run from 10% to 37%. Nadia earns $135,000 as a software engineer and files as single. Her ordinary income puts her in the 24% federal bracket. Her $18,400 short-term gain was added to that income and taxed at 24%. Federal tax: $4,416. Oregon state income tax added another $736, bringing her total capital gains tax bill to $5,152. That's 27.9% of her gain — gone to taxes. And she has only herself to blame (or the slightly unfortunate timing of needing the cash in November rather than January).
Use the Capital Gains Tax Calculator to calculate your specific tax liability on any sale — it accounts for federal brackets, your state's rate, and both holding period scenarios.
Long-Term Capital Gains: The Reason to Wait
Assets held for more than 12 months before selling generate long-term capital gains, which are taxed at preferential rates: 0%, 15%, or 20% at the federal level, depending on your taxable income. These rates are dramatically lower than ordinary income rates for most investors.
For 2025, single filers pay 0% on long-term gains if their taxable income is $47,025 or below. The 15% rate applies from $47,026 to $518,900. The 20% rate only kicks in above $518,900. Married filers get approximately double those thresholds. For Nadia, if she had held her ESPP shares one more month and sold them as long-term capital gains, her $18,400 would have been taxed at 15% federal plus Oregon state tax. Federal: $2,760. State: a smaller impact since Oregon taxes long and short-term gains the same. Total: much less than $5,152.
Why does this rate differential exist? Congress created it to encourage long-term investment rather than short-term speculation, and to avoid punishing people for selling appreciated assets they've held for years. A house bought in 2012 for $280,000 and sold in 2024 for $650,000 generates a $370,000 gain — at 15%, the federal tax is $55,500. At ordinary income rates of 22% or 24%, it would be $81,400 to $88,800. The long-term rate saves a homeowner $25,900 to $33,300 on that single transaction.
The Net Investment Income Tax: The Third Layer
High earners face an additional 3.8% surtax on investment income called the Net Investment Income Tax (NIIT). It applies to single filers with modified adjusted gross income above $200,000 and married filers above $250,000. This surtax applies on top of the regular capital gains rate — so a high earner might pay 20% federal + 3.8% NIIT + state tax = effectively 25% or more on long-term gains.
For Nadia at $135,000 income, the NIIT doesn't apply. But if she were earning $220,000, her $18,400 long-term gain would face 15% + 3.8% = 18.8% federal before Oregon's 9.9% state rate. High-income investors in high-tax states like California, New York, or Oregon can see total effective capital gains rates approaching 35% to 40%. At that level, tax-loss harvesting, retirement account investing, and strategic timing become especially important. The Capital Gains Calculator models the NIIT exposure and shows your effective rate by state.
The Home Sale Exclusion: A Major Tax Break
Selling a primary residence has its own special rules. If you've lived in your home for at least 2 of the last 5 years, you can exclude up to $250,000 in gains from taxes ($500,000 for married couples filing jointly). This is called the Section 121 exclusion, and it's one of the largest tax breaks in the entire US tax code.
A couple who buys a home in 2020 for $380,000 and sells in 2026 for $640,000 has a $260,000 capital gain. With the $500,000 exclusion, the entire gain is tax-free. A single person with the same situation has a $260,000 gain and a $250,000 exclusion — they'd owe tax on $10,000 of gain. These numbers make homeownership genuinely valuable from a tax perspective, particularly in appreciating markets. The exclusion resets with each qualifying sale, meaning you can potentially use it multiple times over a lifetime.
Strategies to Minimize Capital Gains Tax
Knowing the rules creates planning opportunities. One of the most commonly recommended strategies is tax-loss harvesting — selling investments that have declined in value to realize losses that offset gains elsewhere. If Nadia's stock sale produced $18,400 in gains but she also had $6,000 in losses from another position, she'd only owe tax on $12,400. A net gain of $12,400 at 24% is $2,976 rather than $4,416. The Tax Loss Harvesting Calculator can help you identify the optimal offset strategy within your portfolio.
Another key strategy: hold appreciated assets long enough to cross the 12-month threshold. This sounds obvious, but Nadia's story shows how easy it is to sell one month too early. Before selling any investment, check your purchase date. If you're 30 to 60 days from the 12-month mark and can afford to wait, waiting is almost always mathematically correct. A third strategy: contribute highly appreciated stock directly to a charity or donor-advised fund. You avoid the capital gains tax entirely while taking the full market value as a charitable deduction. On $20,000 of appreciated stock, this can be worth $3,000 to $5,000 in combined tax savings compared to selling first and donating cash.
Retirement Accounts and the Capital Gains Shield
Inside a 401(k) or traditional IRA, capital gains are irrelevant — all withdrawals are taxed as ordinary income, regardless of what generated the gains. Inside a Roth IRA, qualified withdrawals are entirely tax-free, including gains. This makes retirement accounts extraordinarily powerful for long-term investing in assets that you expect to appreciate significantly.
Consider holding high-growth investments inside your Roth IRA where possible. Growth that would be subject to 15% to 23.8% in a taxable account generates zero tax in a Roth. Over decades, this difference compounds to enormous amounts. If you expect an investment to triple or quadruple, hold it where the gains face the least tax drag. The Income Tax Calculator can help you model how different account placements affect your overall tax picture.
What Nadia Learned
She waited for the 12-month threshold on every subsequent ESPP sale. She's also started contributing her highest-growth stock positions to her Roth IRA. And she runs a quick capital gains calculation before selling anything — it takes three minutes and has already saved her four figures. The IRS gives you real tools to reduce your investment tax burden. The only requirement is understanding the rules well enough to use them intentionally.
Related Calculators
Written by
Marcus Webb
Personal Finance Writer
Marcus spent eight years as a mortgage loan officer at a regional bank in Nashville before leaving to write about the financial decisions most people get wrong. He's been broke, gotten out of debt, and bought two houses — which he thinks qualifies him to explain this stuff better than someone who's only read about it.