Capital gains and capital losses both have tax implications. When you sell stocks for a profit, you owe taxes on those gains. These taxes are calculated based on capital gains rates. However, when it comes to investments, the IRS taxes you based on your net gains for the entire year. This means that you calculate your taxes based on the total amount of profits you made, after accounting for any investment losses you took during the year.
If you need help with simplifying this process, consider working with a financial advisor who specializes in tax planning.
How the IRS Defines Capital Gains
Capital gains are the money that you make when you sell an investment for a profit. There are two key elements here to understand.
First, the capital gains are calculated as profits rather than net gains. For example, when you sell a stock, your capital gains on that stock sale are calculated as the sale price of the stock minus the price you paid for the stock.
Say you buy 10 shares of stock at $50 per share. You would pay $500 for this stock purchase.
Then, say you sell those 10 shares of stock at $60 per share. You would receive $600 for this stock sale. You would profit $100 from this stock sale (the sale price of $600 less the purchase price of $500). This $100 profit is the taxable capital gain.
Second, capital gains have to be realized in order to be taxed. For tax purposes, a capital gain is realized when you complete the sale of an investment asset. Simple fluctuation in an asset’s price doesn’t trigger capital gains or losses, they simply track your potential value if you were to sell the asset today.
So, if your stock’s price increases in 2025, you would not owe taxes. However, if you were to sell that stock and receive the money from that sale in 2025, you would owe taxes in 2025.
Short-Term vs. Long-Term Capital Gains and Losses
When you sell an investment, the IRS classifies your profit or loss as either short-term or long-term, depending on how long you held the asset before selling it. This distinction matters because each category is taxed at a different capital gains tax rate.
Short-term capital gains and losses apply to assets you’ve held for one year or less. These are taxed as ordinary income, meaning they’re subject to your regular federal income tax rate, which can be as high as 37%.
Long-term capital gains and losses apply to assets you’ve held for more than one year. These typically receive lower tax rates, designed to encourage long-term investing.
When offsetting gains and losses, the IRS requires you to first match short-term with short-term and long-term with long-term. After that, if one category still has a net loss, you can apply the remainder to offset gains in the other category.
Here’s a simplified comparison:
| Type of Gain/Loss | Holding Period | Tax Treatment | Typical Tax Rate Range |
|---|---|---|---|
| Short-Term | 1 year or less | Taxed as ordinary income | 10% to 37% |
| Long-Term | More than 1 year | Taxed at long-term capital gains rates | 0%, 15%, or 20% (depending on income) |
For example, suppose you sell a stock you owned for 10 months at a $2,000 gain and another stock you held for three years at a $1,500 loss. The IRS requires you to net gains and losses within each category first, short-term against short-term and long-term against long-term, before crossing them over. In this case, you have a $2,000 short-term gain and a $1,500 long-term loss with nothing else to net against in either category. Once that step is done, the long-term loss crosses over to offset the short-term gain, leaving you with a net $500 gain. If the numbers went the other way and the loss was larger than the gain, the leftover loss could be used to offset up to $3,000 of ordinary income for the year.
What Are Capital Losses?

Capital gains are taxed annually, just like other income. At the end of the year, all investment profits and losses are added up together. Gains minus losses equals the net number, and that is the amount subject to tax. If the losses are larger than the gains, up to $3,000 of the excess can be deducted against ordinary income, with the rest carried forward to future years. When the net gains for a given year are significant, the IRS expects quarterly estimated tax payments rather than one lump sum at filing time. Skipping those payments and waiting until April can trigger underpayment penalties even if the full amount is paid by the deadline.
Capital losses occur when you sell an investment, such as stocks, for less than what you originally paid. Like capital gains, losses must be realized, which means the sale must be completed; price fluctuations alone don’t count as a loss. The capital loss is calculated as the difference between the selling price and the purchase price.
For example, if you buy 10 shares of stock at $50 per share, your total investment is $500. If you later sell those shares for $40 each, receiving $400 in return, you incur a capital loss of $100 ($500 purchase price minus $400 sale price). This $100 loss can be used to offset your capital gains, potentially reducing your taxable amount.
How to Deduct Capital Losses on Your Taxes
Capital losses, including from the sale of stocks, reduce your taxable capital gains on a dollar-for-dollar basis. If you lose as much as you make in a given year, this can eliminate your taxable capital gains altogether. Should you lose more than you make, you can roll a limited amount of capital losses over to your ordinary income as an income tax deduction.
Here are the two main ways to deduct capital losses from your taxes:
1. Deduct From Capital Gains
When you pay taxes, you calculate both your long- and your short-term capital gains. Long-term capital gains are all the profits you made by selling assets held for more than one year, and they are taxed at the lower capital gains tax rate. Short-term capital gains are all the profits you made by selling assets you held for less than one year. These are taxed as ordinary income.
You calculate your capital losses in the same way, determining both long-term and short-term losses on the same basis.
Your capital losses offset same-category capital gains first. This means that long-term losses first offset any long-term gains, and short-term losses first offset short-term gains. Once your losses exceed your gains, you can carry that category’s losses over to the other.
For example, say you had the following trade profile in a year:
- Long-term gains: $1,000
- Long-term losses: $500
- Short-term gains: $250
- Short-term losses: $400
First, you deduct your long-term losses from your long-term gains, leaving you with taxable long-term capital gains of $500 for the year ($1,000 – $500). The next thing to do is to deduct your short-term losses from your short-term gains. Since your short-term losses are greater than your short-term gains, this leaves you with zero taxable short-term capital gains ($250 gains – $400 losses).
You now carry over excess losses from one category to the next. In this case, your short-term losses exceeded your short-term gains by $150. So, you reduce your remaining long-term gains by that amount, leaving you with taxable long-term capital gains of $350 for the year ($500 long-term gains after losses – $150 excess short-term losses).
2. Deduct Excess Losses From Income
Capital losses can be applied against ordinary income to a limited extent. If your total capital losses exceed your total capital gains, you use those losses as a deduction against your ordinary income. Every year you can claim capital losses up to $3,000 as a deduction against other income on your income taxes (up to $1,500 for married couples filing separately) 1 . If your losses exceed $3,000, you can carry those losses forward as tax deductions in future years.
So, for example, say you have a very bad year on the market. You sell stocks for a total gain of $10,000, but sell other stocks for a total loss of $15,000. You could deduct the first $10,000 of those losses from your capital gains, leaving you with no taxable capital gains for the year. This would leave you with an excess capital loss of $5,000.
You can claim $3,000 of those losses as deductions against your ordinary income taxes for the year. Then, the following year, you can claim the remaining $2,000 as a carried-forward deduction on that year’s income taxes.
Tax Loss Harvesting
Finally, while a full discussion of this subject is beyond the scope of this article, with careful investing you can conduct what’s known as tax loss harvesting. This is the practice of selling assets at a loss in order to maximize the deductions on your taxes.
Usually, the best way to use tax loss harvesting is for timing your sale of already unprofitable assets. If you’re going to lose money on stock anyway, it can be useful to structure the sale around reducing taxable capital gains.
How Capital Gains and Losses Affect Your Tax Return
Capital gains and losses do not stay on one line of a tax return. They flow into adjusted gross income, which affects nearly every other calculation on the return. Knowing how gains and losses offset each other is only part of the picture. Missing the downstream effects can mean paying far more than expected.
A large realized gain increases adjusted gross income (AGI), and that triggers consequences beyond the capital gains tax itself. A higher AGI can phase out the student loan interest deduction, reduce or eliminate eligibility for direct Roth IRA contributions, increase the taxable portion of Social Security benefits and push Medicare premiums higher two years later through IRMAA. Capital losses that offset those gains do not just reduce the capital gains tax. They lower AGI, which can keep income below these thresholds.
The net investment income tax (NIIT) adds a 3.8% surtax on capital gains for individuals with modified adjusted gross income above $200,000 or married couples above $250,000. Someone in the 20% long-term bracket who also owes the NIIT is paying 23.8%, not 20%. A well-timed capital loss can reduce net investment income enough to avoid or shrink the surtax.
The $3,000 annual deduction for excess capital losses against ordinary income does not require itemizing. It reduces adjusted gross income directly whether the standard deduction or itemized deductions are used. That makes it valuable for every filer, not just those with enough deductions to itemize.
The wash sale rule limits the ability to harvest losses. Selling a stock at a loss and buying the same or a substantially identical security within 30 days before or after the sale means the IRS disallows the loss for that tax year. The disallowed loss gets added to the cost basis of the replacement shares, which defers the benefit until those shares are eventually sold. To harvest losses cleanly, wait at least 31 days before repurchasing or buy a similar but not identical investment to stay in the market without triggering the rule.
State taxes are the piece most articles skip. Some states tax capital gains as ordinary income at rates as high as 13.3%. Others have no income tax at all. A $100,000 long-term gain in California could cost roughly $30,000 in combined federal, NIIT and state taxes. The same gain in Texas costs about $18,800. Where a gain is realized matters as much as how long the asset was held.
Bottom Line

Each year, you are taxed on your total net capital gains for the year. This means that when you make money selling your stocks, you can deduct any money that you lose selling stocks. This lets you reduce your total taxable capital gains for the year. This is an important practice to be aware of, especially if you’re not working with a professional, so that you can maximize your tax deductions and lower how much you owe.
Tips on Taxes
- It’s always better to avoid potential losses, which is where you may want to consider enlisting help. You can work with a financial advisor who can manage your assets for you or help you create the right asset allocation plan. Finding the right financial advisor doesn’t have to be hard. SmartAsset’s free tool matches you with financial advisors who serve your area. You can interview your advisor matches at no cost to decide which one is right for you. If you’re ready to find an advisor who can help you achieve your financial goals, get started now.
- Tax loss harvesting may be beyond the scope of this article, but SmartAsset’s Elizabeth Stapleton dives into the subject. If you have to lose money on the stock market, learn how to make it count.
Photo credit: ©iStock.com/nortonrsx, ©iStock.com/Avalon_Studio, ©iStock.com/Koonsiri Boonnak
Article Sources
All articles are reviewed and updated by SmartAsset’s fact-checkers for accuracy. Visit our Editorial Policy for more details on our overall journalistic standards.
- “Topic No. 409, Capital Gains and Losses | Internal Revenue Service.” Home, https://www.irs.gov/taxtopics/tc409. Accessed 13 Nov. 2025.
