Capital gains tax is a tax on the profit you make from selling stocks (or other investments). You only pay tax when you sell and “realize” the gain. If your stocks went up but you didn’t sell, that profit is unrealized and not taxed yet.
If you sell a stock after owning it for one year or less, that’s a short-term capital gain. Short-term gains are taxed just like your regular income (the same tax rate you pay on your salary or wages). This rate could be anywhere from about 10% up to 37%, depending on your total income.
If you sell after holding the stock for more than one year, that’s a long-term capital gain. Long-term gains get special lower tax rates to encourage long-term investing. Depending on your taxable income, your long-term capital gains are taxed at 0%, 15%, or 20% (much lower than most regular income tax rates). For example, a middle-income single person might pay 15% on long-term gains, whereas a very high-income investor might pay 20%. (By contrast, the same profit taken as a short-term gain could be taxed at a much higher rate.)
2024 vs 2025 Long-Term Capital Gains Brackets: Tax brackets adjust yearly for inflation. In 2024, a single filer pays 0% on long-term capital gains up to about $47,025 of taxable income (double that, $94,050, for married couples filing jointly). Above that, the rate is 15% until income reaches $518,900 (single) or $583,750 (joint). Income beyond those levels faces the 20% rate. In 2025, these thresholds increase slightly: 0% rate for single filers up to about $48,350 (about $96,700 for joint filers), 15% up to roughly $533,400 (single) or $600,050 (joint), and 20% on incomes above that. (Short-term gains, meanwhile, don’t have special brackets – they’re taxed at whatever your normal income tax rate is.)
3.8% Medicare Surtax (Net Investment Income Tax): High earners need to watch for this. If your modified adjusted gross income is over $200,000 (single) or $250,000 (married filing jointly), investment income – including capital gains – can also incur an additional 3.8% tax. This surtax is on top of the regular capital gains tax rates. In effect, wealthy investors can end up paying 18.8% or 23.8% federal tax on long-term gains (instead of 15% or 20%). The surtax only applies to the portion of your investment income above those income thresholds, but it’s an important factor if you’re in a high tax bracket.
Offsetting Gains with Losses: The IRS lets you use capital losses (losing investments) to offset your capital gains (winners) so you’re taxed only on your net profit. If you have more losses than gains in a year, you can use up to $3,000 of that extra loss to reduce your other income (like salary). This can lower your overall tax bill. Any losses beyond $3,000 can be carried forward to future years. They don’t expire – you can keep using carried-over losses to offset gains (and up to $3k of ordinary income each year) until they’re used up. For example, if you lost $10,000 in stocks and had no gains this year, you could deduct $3,000 of that against your other income now and carry the remaining $7,000 loss into next year’s taxes.
Tax-Loss Harvesting: This is a strategy where you intentionally sell investments at a loss to lock in a tax deduction. Investors often do this toward year-end or whenever they have profits to offset. By realizing a loss, you can cancel out some gains (or use up to $3k against other income as mentioned). Important: after selling a stock for a loss, you can’t buy the same or a “substantially identical” stock or fund within 30 days before or after the sale. That’s the wash-sale rule. If you do, the IRS won’t allow your loss for tax purposes. In plain terms, you can’t sell a stock to claim a tax loss and then turn around and rebuy it immediately – you have to wait at least 31 days (or buy a different investment) to keep the loss deduction. Tax-loss harvesting can save you money, but you must be careful to avoid the wash-sale trap.
Understanding Capital Gains Taxes on Stocks
Many first-time investors are caught off guard by taxes on their stock profits. Imagine you bought shares of a company, watched the price climb, sold for a nice gain, and then come tax time you find out the IRS wants a portion of your profit. That surprise leads to the question: “Wait, I have to pay tax on this?” Yes – if you make money by selling stocks, you may owe taxes on that profit, called a capital gain. But how much tax and when it’s applied depends on several factors. Don’t worry, though: we’ll break down the key things you need to know about capital gains taxes on stocks in plain English.
Realized vs. Unrealized Gains: You’re Only Taxed When You Sell
First, it’s crucial to understand realized vs. unrealized gains. An unrealized gain (sometimes called a “paper gain”) is the increase in value of a stock you haven’t sold yet. For example, if you bought shares at $100 and now they’re worth $150, you have a $50 per share gain on paper. However, because you haven’t sold the stock, that gain is unrealized – it’s just a number on paper (or on your screen). You don’t pay any taxes on unrealized gains. The IRS doesn’t tax you for watching your stock go up in value.
A realized gain, on the other hand, is when you sell the stock for more than you paid. Using the same example: if you sell those shares at $150, you’ve “realized” a $50 profit per share. That realized profit is a capital gain, and it’s taxable. In the eyes of the IRS, you’ve made income from the sale, and they expect their cut.
Key point: No sale, no tax. You aren’t taxed on a rise in your stock’s value until you actually sell and lock in the profit. This is why some wealthy investors can have a lot of net worth on paper (in stocks, real estate, etc.) but pay relatively little tax in a given year – because unless they sell assets at a gain, those gains stay untaxed.
The same concept works for losses: if your stock’s price drops below what you paid, that’s an unrealized loss until you sell. Selling below your purchase price locks in a realized capital loss. Realized losses can actually help reduce your taxes (more on that later), whereas unrealized losses don’t affect your taxes yet.
Short-Term vs. Long-Term Capital Gains
Not all gains are treated equally. U.S. tax law distinguishes between short-term and long-term capital gains, and the difference can dramatically affect how much tax you pay on your stock profits.
Short-Term Capital Gains: These are gains on assets (like stocks) that you held for one year or less before selling. Short-term gains are taxed at your ordinary income tax rates. That means they are treated just like wages, salary, or any other income on your tax return. Depending on your total income, your federal tax rate on short-term gains could be anywhere from 10% (if you’re in the lowest tax bracket) to as high as 37% (the top bracket in 2024 and 2025). In other words, a short-term stock profit can potentially push you into a higher tax bracket or be taxed at the highest rates you pay on any income. For many people, this can result in a much bigger tax bite compared to long-term gains.
Long-Term Capital Gains: These are gains on assets you held for more than one year (at least 366 days – one year plus one day) before selling. Long-term capital gains are rewarded with lower preferential tax rates. The federal long-term capital gains tax rates for individuals are 0%, 15%, or 20%, depending on your taxable income. These rates are generally much lower than the rates for short-term gains, especially for higher-income levels. The policy behind this is to encourage long-term investment holding.
To determine whether your gain is short-term or long-term, count the days from the day after you bought the stock up to and including the day you sell it. If that span is one year or less, it’s short-term; if it’s more than one year, it’s long-term.
Why does this matter? Because long-term gains typically result in a lower tax bill. For example, if you earned a $5,000 profit on a stock:
If it’s a short-term gain and you’re in, say, the 24% ordinary tax bracket, you’d pay 24% of that $5,000 in federal tax (about $1,200).
If it’s a long-term gain and you fall in the 15% capital gains bracket, you’d pay 15% of that $5,000 (about $750). It’s a big difference. For very high earners, the difference is even more stark: the top ordinary income tax rate is 37%, while the top long-term capital gains rate is 20%. This disparity is why tax advisors often suggest holding investments for at least a year when possible, to qualify for the long-term rate.
2024 and 2025 Long-Term Capital Gains Tax Brackets
The exact income thresholds for the 0%, 15%, and 20% long-term capital gains rates adjust slightly each year due to inflation. Here are the federal long-term capital gains tax brackets for 2024 and 2025 (for the most common filing statuses):
2024 Long-Term Capital Gains Rates: – 0% tax on long-term gains if your taxable income is up to $47,025 (for single filers). For married couples filing jointly, 0% applies up to $94,050 of income. – 15% tax on long-term gains for taxable incomes from $47,026 up to $518,900 (single). For married joint filers, 15% applies from $94,051 up to $583,750 of income. – 20% tax on long-term gains for taxable income above $518,900 (single). For married couples filing jointly, 20% kicks in above $583,750 of taxable income.
2025 Long-Term Capital Gains Rates: – 0% tax rate on long-term gains for taxable income up to about $48,350 (single). For married joint filers, 0% goes up to about $96,700 of income. – 15% tax rate for incomes roughly from $48,351 to $533,400 (single). Married filing jointly couples see 15% from about $96,701 to $600,050. – 20% tax rate on any long-term gains once income exceeds approximately $533,400 (single), or $600,050 for married joint filers.
(Heads up: “taxable income” here means your income after deductions, not just your salary. Also, these brackets apply to net long-term gains. The thresholds might sound high, but remember they include all your taxable income – not just the gains themselves. For instance, a single filer with $50,000 of taxable income (including any gains) would be in the 15% capital gains bracket, because $50,000 is above the $48,350 threshold.)
Notice that the long-term capital gains brackets for married couples filing jointly are roughly double the single amounts for the 0% rate, and somewhat higher for the 15% and 20% thresholds. If you file as Head of Household or Married Filing Separately, there are specific thresholds for those as well (HOH is usually in between single and joint, and MFS is generally half of joint). The key takeaway is long-term gains can potentially be tax-free (0%) for lower incomes, and even at higher incomes, they’re taxed at a favorable rate compared to short-term gains.
Short-Term gains, by contrast, don’t have special brackets – they’re just taxed according to the regular federal income tax brackets for that year. In 2024 and 2025, there are seven ordinary tax brackets (10%, 12%, 22%, 24%, 32%, 35%, 37%). A short-term gain will be taxed at whatever bracket your total income falls into. So if your stock sale pushes you into a higher bracket, parts of that gain could be taxed at multiple rates, just like additional salary would. For simplicity: think of short-term gains as “just more income” on top of your paycheck, and taxed as such.
The 3.8% Medicare Surtax on Investment Income (Net Investment Income Tax)
In addition to the regular capital gains tax rates discussed above, high-income investors should be aware of an additional tax that can apply to investment income, including capital gains from stocks. This is commonly called the Medicare surtax or the Net Investment Income Tax (NIIT). It’s a 3.8% extra federal tax on investment income for people above certain income thresholds.
Here’s how it works in a nutshell: if your modified adjusted gross income (MAGI) is above $200,000 for single filers (or above $250,000 for married couples filing jointly), you may owe this 3.8% tax on your net investment income (things like capital gains, dividends, interest, rental income, etc.). For married individuals filing separately, the threshold is lower (MAGI above $125,000). Heads of household use the single $200,000 threshold.
The 3.8% NIIT applies in addition to the regular income tax or capital gains tax you owe. It does not increase your tax brackets; instead, it’s a flat 3.8% surtax on the lesser of your net investment income or the amount by which your MAGI exceeds the threshold. In simpler terms, if you’re over the income threshold, you’ll likely pay an extra 3.8% on some or all of your investment profits.
Example: Let’s say you’re a single filer with $230,000 of MAGI, which includes $50,000 of net investment income (perhaps from stock gains). You are $30,000 over the $200,000 NIIT threshold. The 3.8% tax would apply to the lesser of your net investment income ($50k) or the over-threshold amount ($30k). So you’d owe an extra 3.8% on $30,000 (that’s $1,140) as the NIIT. You’d still pay the regular capital gains tax on the $50k, but the portion of that gain that pushed you over the threshold gets this surtax. If your investment income was smaller or your other income was higher, the calculation could differ, but the takeaway is: above certain incomes, investment gains can trigger an extra 3.8% tax.
In practical terms, because of this surtax, the effective top tax rate on long-term capital gains for high earners isn’t just 20% – it becomes 23.8% (20% + 3.8%). Similarly, someone in the 15% long-term bracket who is above the NIIT income threshold would effectively pay 18.8% on those gains. And short-term gains for high earners could be taxed at 40.8% (37% + 3.8%).
It’s worth noting that the NIIT thresholds ($200k/$250k) are not indexed for inflation – they’ve been the same since this tax was introduced in 2013. This means each year, more people could slowly become subject to this tax as incomes rise with inflation. So even if you’re not a “millionaire,” you could hit these levels, especially if you realize a large one-time gain (for example, selling a business or a sizable stock holding in a good year).
Bottom line: If you’re a higher-income investor, be prepared for that extra 3.8% on your investment profits. It’s essentially the government’s way of ensuring upper-income folks contribute a bit more, earmarked (in theory) for Medicare. When figuring out how much you’ll owe on a big stock sale, remember to factor this in if your income is above the threshold.
Using Capital Losses to Offset Gains (and Income)
Investing isn’t always a straight line up – sometimes you sell stocks at a loss. The good news is, those capital losses can actually be useful at tax time. The tax code allows you to offset your gains with losses, which can significantly reduce your tax bill.
Here’s how it works:
First, in any given tax year, you net your capital gains and losses. This means you add up all your capital gains from selling stocks (and other capital assets, if any) and all your capital losses from selling investments. They can cancel each other out. For example, suppose you sold Stock A for a $10,000 gain and Stock B for a $7,000 loss in the same year. Your net capital gain for the year would be $3,000 (because the $7,000 loss offsets part of the $10,000 gain). You would only be taxed on that net $3,000 gain, not the full $10,000 from the winning stock. Essentially, the losses reduce the amount of gains that are subject to tax.
Now, if your losses exceed your gains – meaning overall you had a net loss for the year – you can use that net loss to reduce your other income, up to a certain limit. Specifically, you can deduct up to $3,000 of net capital losses per year against your ordinary income (like wages, salary, interest, etc.). If you’re married filing separately, it’s $1,500 per person per year. This deduction directly reduces your taxable income, which can lower your tax bill. Using a simple scenario: let’s say over the year you had no gains and a net capital loss of $3,000 (maybe you sold some losing stocks and didn’t have any winners). You could deduct that full $3,000 against, say, your salary. If you’re in the 22% tax bracket, a $3,000 deduction saves you about $660 in federal tax that year. It’s a small consolation for losing money on investments, but it softens the blow.
Carryover of Losses: What if your net losses are more than $3,000? Can you only ever use $3,000? Fortunately, you don’t lose the excess. You can carry forward any unused capital losses to future years, indefinitely, until they’re used up. Each year you can again use up to $3,000 of carried-over losses against ordinary income (plus of course any amount to offset new gains). For example, say you had a really rough year and realized a $10,000 net capital loss. You use $3,000 of it in the current year to offset ordinary income. That leaves $7,000 of loss unused. That $7,000 carries over to next year. Next year, suppose you have some capital gains; you can use the carried $7,000 to offset those gains first. If you still have some of the loss left after offsetting gains (or if you had no gains next year), you could use up to $3,000 of whatever remains to again reduce ordinary income in that next year, and then carry the rest forward further. You keep doing this year by year until the loss is fully used. In the example, if there were no gains in future years, you’d use the $7,000 carryover by deducting $3,000 in year 2, $3,000 in year 3, and the remaining $1,000 in year 4.
A few additional points to clarify:
No limit on offsetting gains: You can use capital losses to offset 100% of your capital gains in a year. The $3,000 limit only applies to using losses beyond that to offset other income. For instance, if you have $50,000 in gains and $50,000 in losses in the same year, they fully cancel out – you pay no tax on those gains because your net gain is zero. (You don’t get to deduct an extra $3k because you didn’t have a net loss; you just eliminated your gains, which is still a win at tax time.) The $3,000 rule is just an extra bonus if your losses outpace your gains.
Capital loss deductions don’t reduce capital gains tax rates: Using losses to offset gains simply reduces the amount of gain that’s subject to tax. It doesn’t change whether you pay 15% or 20%, etc. It just might reduce the dollars of gain you have to apply those rates to. Reducing taxable income via losses also could potentially drop you into a lower tax bracket for ordinary income or even for capital gains if your income falls below a threshold, but that’s situational.
Timing matters: Capital losses and gains count in the year you realize them (the year you sell). If you had a big gain last year and a big loss this year, you can’t retroactively apply this year’s loss to last year’s gain. (However, that carryover helps future gains, as explained.)
In practice, smart investors will harvest losses strategically (which we’ll discuss next) to make sure they use at least that $3,000 deduction if they have losses sitting around. Nobody likes losing money on stocks, but at least the tax code gives you a silver lining by letting losses cut your tax bill.
Tax-Loss Harvesting and the Wash-Sale Rule
One popular strategy that comes up when discussing capital gains and losses is tax-loss harvesting. This is a tactic where investors sell investments at a loss on purpose to capture the tax benefits of those losses, as described above.
Why would someone intentionally sell at a loss? Imagine it’s late in the year and you’ve made significant gains from some stock sales (and thus owe taxes on those gains). You look at your portfolio and see another stock that’s down – you’re sitting on an unrealized loss. If you sell that losing investment before year-end, you realize the loss and can use it to offset the taxes on your gains. Even if you still believe in the investment long-term, you might sell it just to get the tax break now (and potentially buy a similar investment right away to keep your money in the market). By doing so, you “harvest” the loss for tax purposes.
Tax-loss harvesting isn’t only for offsetting gains; even in a year when your portfolio is down overall, you might harvest some losses to utilize the $3,000 deduction against income, carrying over the rest. Over multiple years, harvesting losses can save a lot on taxes, boosting your after-tax returns.
However, there’s a big caveat: the wash-sale rule. The IRS doesn’t let you abuse loss harvesting by selling and immediately rebuying the exact same investment just to claim a tax loss. The wash-sale rule says that if you sell a security at a loss, you cannot buy the same or a “substantially identical” security within the 30-day period before or after the sale. In effect, you need to stay out of that investment for at least 31 days for the loss to count for taxes. If you violate this rule, the loss is disallowed (you don’t get to use it to offset gains or income). Instead, the amount of the loss gets added to the cost basis of the new shares you bought, effectively postponing the benefit until you eventually sell those.
Example of a Wash Sale: You purchase 100 shares of XYZ stock for $10,000. Later, the stock’s value falls and your shares are now worth $7,000. You decide to sell them, realizing a $3,000 loss. If you do nothing else, you can use that $3,000 loss to offset other gains or income. But suppose you really believe XYZ will recover and you want to own it. If you buy 100 shares of XYZ stock again just 5 days later at $7,100, you have repurchased essentially the same investment within the 30-day window. That triggers the wash-sale rule. The $3,000 loss from the sale is not allowed as a current deduction. Instead, that $3,000 is added to the basis of your new shares (so your new basis would effectively be $7,000 + $3,000 = $10,000). You haven’t lost the $3k forever – it’s built into the new cost basis, which will reduce taxable gains (or increase losses) when you eventually sell those new shares. But for now, you’ve lost the immediate tax benefit of selling at a loss. In short, the IRS says “nice try, but no” to harvesting a loss if you replace the position right away.
“Substantially identical” means the rule isn’t just about literally the same stock. It mostly comes into play with things like funds. For instance, if you sell shares of a S&P 500 index fund at a loss, and the next week buy a different S&P 500 index fund (from another provider), the IRS could consider those substantially identical – after all, they track the same index with almost the same holdings. That would be a wash sale. However, you could sell that S&P 500 fund and buy a similar but not identical investment, like a Total Stock Market index fund or a Large-Cap fund, to maintain exposure without violating the rule. Or simply wait 31 days then buy back the original investment. The key is you have to take a little bit of risk of being out of that specific investment (or use an alternate investment) for 30 days if you want the loss to count.
Tax-loss harvesting thus often involves selling a loser, immediately reinvesting the money in something reasonably comparable (but not a clone of what you sold) for at least 31 days, and then if desired, switching back to the original investment later on. This way, your portfolio stays invested, but you’ve locked in the tax loss. It’s a savvy strategy, especially in volatile markets or down years, to save on taxes. Just keep good records of your trades and watch those dates to avoid an accidental wash sale.
A couple of final notes on harvesting and wash sales:
The wash-sale rule applies across your accounts. For example, if you sell a stock in your taxable brokerage account to harvest a loss, you have to be careful not to accidentally purchase the same stock in your IRA within that 30-day window, or that too could trigger a wash sale (even though the accounts are separate, the IRS looks at your total holdings).
Harvesting losses doesn’t make sense in tax-advantaged accounts (like retirement accounts) because you can’t deduct losses in those, and transactions inside IRAs or 401(k)s aren’t taxed as capital gains either. So this strategy is purely for taxable investment accounts.
Bringing It All Together
Investing in stocks is a great way to build wealth, but it also comes with tax responsibilities. To recap:
You don’t owe tax until you sell and realize a gain. If you haven’t sold, the gain (or loss) is just on paper for now.
How long you hold the stock before selling determines if you get a lower tax rate (long-term) or have to pay your regular rate (short-term) on the profit.
Know the brackets: Long-term capital gains rates (0%, 15%, 20%) depend on your income – and these brackets adjust each year. Many average investors fall in the 15% bracket for long-term gains, but some qualify for 0% (a great deal!) and the very wealthy hit 20%. In contrast, short-term gains could be taxed at much higher rates because they’re treated like ordinary income.
Beware the surtax: High-income investors should account for the additional 3.8% NIIT on investment income, which raises the effective tax rate on gains.
Use your losses: If some of your investments lost money, you can use those losses to offset your winners, reducing your taxable gains. And even beyond that, a limited amount of extra losses can trim down your other income each year. Keep track of any carryover losses to use in future years.
Harvest smartly (but follow the rules): Tax-loss harvesting is a valuable technique to save on taxes, but you must avoid wash sales. If you harvest, either wait out the 30 days before rebuying the same asset or pick a different investment to replace it temporarily.
By understanding these rules, you can make more informed decisions about when to sell investments and how to plan for the tax impact. For example, you might decide to hold onto a stock a bit longer to qualify for long-term gain treatment, or sell an underperforming stock by December to snag a tax deduction. Tax considerations shouldn’t drive every investment decision, but they’re an important part of the overall strategy because they directly affect your net returns (what you actually keep in your pocket).
Finally, remember that everyone’s tax situation can be a bit different. The principles above apply to federal taxes and assume typical scenarios. State taxes can also apply to capital gains (many states tax all capital gains as ordinary income, though some have special rates or exemptions – it’s worth checking your state’s rules). And some specific cases (like selling a home, or receiving stock as a gift or inheritance, or stock options) have their own special tax treatments not fully covered here.
If you’re dealing with significant stock sales or complex situations, it may be wise to consult a tax professional or financial advisor. They can provide personalized guidance, ensure you’re following all the rules, and help you strategize the best way to manage investments with taxes in mind.
In summary: Capital gains taxes are an integral part of investing. Being aware of how they work – knowing the difference between realized and unrealized gains, the breakpoints for short-term vs. long-term, the extra bite for high earners, and the silver lining of capital losses – will help you become a more tax-savvy investor. With this knowledge, you won’t be caught saying “I have to pay tax on this?!” after the fact; instead, you’ll plan ahead and make decisions that maximize your after-tax returns. Happy investing (and wise tax planning)!

