How Stock Gains Are Taxed in the United States
When you sell stock for a profit, the gain is subject to capital gains tax. The tax rate depends primarily on how long you held the stock. Short-term capital gains (held less than one year) are taxed at your ordinary income tax rate, which can be as high as 37%. Long-term capital gains (held more than one year) are taxed at preferential rates of 0%, 15%, or 20% depending on your income level. This difference can save you thousands of dollars per year in taxes.
In addition to federal taxes, many states impose their own capital gains tax. States like California (13.3%), New York (10.9%), and New Jersey (10.75%) have high state income tax rates that apply to investment gains. Some states like Florida, Texas, Nevada, and Washington have no state income tax. High-income investors may also owe the 3.8% Net Investment Income Tax (NIIT) on investment income exceeding $200,000 (single) or $250,000 (married filing jointly).
Capital Gains Tax Formulas
- 1Capital gain = ($80 - $50) x 100 = $3,000
- 2Long-term federal rate (24% bracket) = 15%
- 3Federal tax = $3,000 x 15% = $450
- 4State tax = $3,000 x 5% = $150
- 5NIIT (assume under threshold) = $0
- 6Total tax = $450 + $150 = $600
- 7After-tax profit = $3,000 - $600 = $2,400
Long-Term Capital Gains Tax Rates (2026)
| Filing Status | 0% Rate | 15% Rate | 20% Rate |
|---|---|---|---|
| Single | Up to $47,025 | $47,026 - $518,900 | Over $518,900 |
| Married Joint | Up to $94,050 | $94,051 - $583,750 | Over $583,750 |
| Head of Household | Up to $63,000 | $63,001 - $551,350 | Over $551,350 |
Tax-Loss Harvesting Strategy
Tax-loss harvesting is the practice of selling losing investments to offset capital gains from winning investments, reducing your overall tax bill. If your capital losses exceed your capital gains, you can deduct up to $3,000 of excess losses against ordinary income per year ($1,500 if married filing separately). Unused losses carry forward indefinitely. Be aware of the wash sale rule, which prevents you from claiming a loss if you repurchase the same or substantially identical security within 30 days.
The IRS wash sale rule disallows a capital loss deduction if you buy the same stock (or substantially identical security) within 30 days before or after the sale at a loss. The disallowed loss is added to the cost basis of the replacement shares. This rule applies across all accounts (brokerage, IRA, spouse's accounts). Violating wash sale rules can result in unexpected tax consequences.
- Sell losing positions to generate capital losses before year-end to offset gains.
- Wait 31 days before repurchasing to avoid the wash sale rule, or buy a similar but not identical ETF or stock.
- Carry forward unused losses to future years with no expiration.
- Consider donating appreciated stock to charity to avoid capital gains tax entirely while getting a deduction.
- If you are in a 0% long-term capital gains bracket, consider selling appreciated stock and immediately repurchasing to reset your cost basis higher (tax-gain harvesting).
Capital Gains Tax in Canada
In Canada, capital gains are taxed differently than in the US. Only 50% of capital gains are included in taxable income (the inclusion rate). For example, a $10,000 capital gain results in $5,000 of taxable income, which is then taxed at your marginal tax rate. Canada does not distinguish between short-term and long-term holding periods for capital gains purposes. Capital gains are reported on Schedule 3 of the T1 tax return. The capital gains inclusion rate may be changing in future tax years, so consult a Canadian tax professional for current rules.