Selling Stock Taxes: How Much You'll Pay on Investment Gains
Consider two investors who each sell $50,000 worth of Apple stock and realize a $20,000 gain. Investor A held the shares for 14 months. Investor B held for 11 months. Investor A pays $3,000 in federal tax. Investor B pays $4,400 — a difference of $1,400 from a single calendar timing decision. That gap is the capital gains tax system at work. Understanding the holding period rules, 2026 income thresholds, the net investment income tax, and strategies like tax-loss harvesting can reduce what you hand to the IRS by thousands of dollars every year.
Key Takeaways
- • Assets held over one year qualify for long-term rates of 0%, 15%, or 20% — assets held one year or less are taxed at ordinary income rates up to 37%
- • In 2026, single filers with taxable income under $49,450 pay 0% on long-term capital gains
- • High earners (income above $200,000 single / $250,000 MFJ) owe an additional 3.8% Net Investment Income Tax
- • You report stock sales on Form 8949 and Schedule D, using the 1099-B your broker sends
- • Tax-loss harvesting — selling losing positions to offset gains — is the most actionable year-end strategy for taxable accounts
How Capital Gains Tax on Stocks Works: The Holding Period Rule
Under IRC Section 1222, a capital gain or loss is classified as short-term or long-term based on how long you held the asset before selling. The dividing line is exactly one year — 365 days, not 12 calendar months. Sell one day too early and you pay ordinary income rates; wait until day 366 and the preferential long-term rates apply.
Your holding period begins the day after you acquire shares and includes the day you sell. For stocks purchased through a broker, the settlement date (T+1 for most US equities since 2024) is what determines your basis date — though most brokers track this automatically. For gifted or inherited shares, different rules apply to both the holding period and the cost basis.
The gain or loss itself is calculated as the amount realized (sale price) minus your cost basis (what you originally paid, including commissions). If you purchased 100 shares of a stock at $45 per share ($4,500 total) and sold at $72 per share ($7,200), your capital gain is $2,700. Use our capital gains tax calculator to run your exact numbers by filing status and income.
2026 Long-Term Capital Gains Tax Rates and Income Thresholds
The IRS adjusts capital gains brackets annually for inflation under Rev. Proc. 2025-38. For 2026, the thresholds are based on taxable income (not adjusted gross income), after the standard or itemized deduction is applied.
| Rate | Single | Married Filing Jointly | Head of Household |
|---|---|---|---|
| 0% | Up to $49,450 | Up to $98,900 | Up to $66,200 |
| 15% | $49,451 – $551,350 | $98,901 – $613,700 | $66,201 – $582,400 |
| 20% | Over $551,350 | Over $613,700 | Over $582,400 |
Source: IRS Rev. Proc. 2025-38. Thresholds based on 2026 taxable income (after standard/itemized deduction). Does not include 3.8% NIIT applicable above $200,000/$250,000 MAGI.
The 0% bracket is one of the most underutilized tax planning opportunities in personal finance. A married couple filing jointly with $75,000 in taxable income could realize up to $23,900 in long-term capital gains this year and pay zero federal tax on those gains. Per the Tax Foundation's 2025 analysis, fewer than 40% of taxpayers eligible for the 0% rate strategically harvest gains to take advantage of it.
Short-Term Capital Gains: Ordinary Income Rates Apply
Stocks held one year or less generate short-term capital gains taxed at your ordinary income tax rate — the same rate as your W-2 wages, freelance income, or interest income. In 2026, that means rates from 10% to 37% depending on your total taxable income.
The math is stark. Consider a single filer with $120,000 in W-2 income who sells stock for a $15,000 short-term gain. That gain sits in the 24% bracket. They pay $3,600 in federal tax. If they had waited until the position crossed one year, the same $15,000 long-term gain would be taxed at 15%, or $2,250. Patience saves $1,350 on a single trade. Run the comparison for your own situation with our tax bracket calculator.
There is no special "day trading" tax rate — frequent traders who generate short-term gains simply pay ordinary income rates on each profitable sale. Some active traders qualify to elect "mark-to-market" accounting under IRC Section 475(f), which converts capital gains and losses to ordinary income and losses — beneficial mainly for those with large losses, since ordinary losses aren't subject to the $3,000 capital loss limitation.
The Net Investment Income Tax: An Extra 3.8% for High Earners
Under IRC Section 1411, individuals with modified adjusted gross income above $200,000 (single) or $250,000 (married filing jointly) owe an additional 3.8% Net Investment Income Tax (NIIT) on the lesser of their net investment income or the amount by which MAGI exceeds the threshold.
Net investment income includes capital gains from stock sales, dividends, interest, rental income, and passive business income. It does not include wages or self-employment income. The NIIT is reported on Form 8960 and stacks on top of the regular capital gains rate — so a high-income single filer pays 20% + 3.8% = 23.8% on long-term gains above the threshold.
Example: NIIT Impact at High Income
Single filer. MAGI: $350,000. Long-term stock gains: $80,000.
Regular long-term rate: 20% × $80,000 = $16,000
NIIT: 3.8% × $80,000 = $3,040 (entire gain since MAGI far exceeds $200,000 threshold)
Total federal capital gains tax: $19,040 (effective rate: 23.8%)
State capital gains taxes would add further to the total bill.
How to Report Stock Sales: Form 8949 and Schedule D
Your broker sends Form 1099-B by February 15 each year, listing every stock sale from the prior year — the proceeds, your cost basis (if they have it), and whether the gain is short or long-term. You use this information to complete Form 8949, which lists each individual transaction, and then summarize on Schedule D (Capital Gains and Losses), which flows to Form 1040 Line 7.
Form 8949 has three key checkboxes per transaction section: Box A (broker reported basis to IRS), Box B (broker reported proceeds but NOT basis), or Box C (proceeds not reported to IRS). Most standard brokerage sales fall under Box A. Each transaction requires a description of the property, date acquired, date sold, proceeds, cost basis, any adjustments, and the resulting gain or loss.
If you have many transactions (common for active traders or those who reinvest dividends), you can import your 1099-B directly into tax software like TurboTax or H&R Block rather than entering each trade manually. You still attach Form 8949 — the software generates it from the import.
Cost Basis Methods: Which One to Choose
If you've purchased shares of the same stock at different times and prices, you need a cost basis method to determine which shares you're selling. The IRS allows several:
- FIFO (First In, First Out): The default method. Oldest shares are sold first. In a rising market, this often creates the largest gains (and thus highest taxes) since your oldest shares typically have the lowest basis.
- Specific identification: You designate exactly which shares to sell, allowing you to select the highest-basis shares to minimize gains or select shares held longer than one year to qualify for long-term rates. Must be elected before the trade settles.
- Average cost: Available for mutual funds and some ETFs. Averages all share purchases. Cannot be used for individual stocks.
- LIFO (Last In, First Out): Sells most recently purchased shares first. Rarely advantageous for tax purposes.
Specific identification is almost always the optimal method for tax efficiency. The ability to cherry-pick your highest-basis shares — or shares held just over one year to qualify for long-term rates — gives you direct control over your annual capital gains.
The Wash Sale Rule: A Common Pitfall for Loss Harvesters
Under IRC Section 1091, you cannot claim a capital loss if you buy the same or "substantially identical" security within 30 days before or after the sale. This 61-day window (30 days before + sale day + 30 days after) prevents investors from selling to claim a tax loss while immediately buying back the same position.
The disallowed loss is not permanently lost — it is added to the cost basis of the replacement shares. But it defers the deduction, which matters if you're trying to offset gains in the current tax year. Common wash sale traps that catch investors off guard:
- Selling stock at a loss in your taxable brokerage account and buying it in your IRA within the 30-day window (the IRA purchase counts, even though it's a different account)
- Selling a stock fund and buying a near-identical ETF from the same provider tracking the same index (the IRS hasn't definitively ruled on all ETF pairs, but substantially similar funds are at risk)
- Selling stock options and buying the underlying stock within the window
- Having dividend reinvestment automatically purchase shares of a stock you just sold at a loss
Note: the wash sale rule currently applies to stocks and securities, but not to cryptocurrency. Crypto investors can sell at a loss and immediately buy back — a gap that has made crypto tax-loss harvesting especially aggressive. Proposed legislation to extend wash sale rules to crypto has been introduced but not enacted as of 2026.
Tax-Loss Harvesting: Turning Losers Into Tax Savings
Tax-loss harvesting means deliberately selling positions at a loss to generate capital losses that offset capital gains, reducing your taxable gain for the year. Capital losses first offset capital gains of the same type (short-term against short-term, long-term against long-term), then offset opposite-type gains. If losses exceed all gains, you can deduct up to $3,000 of net capital losses against ordinary income per year (under IRC Section 1211(b)), with any remaining loss carrying forward indefinitely.
Vanguard's 2024 research found that systematic tax-loss harvesting can add 0.5–1.5% to after-tax portfolio returns annually, depending on market conditions and portfolio turnover. In a volatile market year, the opportunity is larger. The strategy requires active monitoring — December is the most common window for year-end loss harvesting, but opportunities exist throughout the year in down markets.
Special Cases: Inherited Stock, Gifted Stock, and Employee Equity
Inherited Stock: The Step-Up in Basis
When you inherit stock, your cost basis is "stepped up" to the fair market value on the date of the decedent's death (or the alternate valuation date six months later, if the estate elects it). If your parent bought Apple stock at $10 per share decades ago and it's worth $200 when they die, your basis is $200 — not $10. Selling immediately triggers zero capital gains tax. The holding period is automatically treated as long-term regardless of when you actually sell. This is one of the most powerful tax provisions in the US tax code for intergenerational wealth transfer.
Gifted Stock: Carryover Basis
Receiving stock as a gift means you generally take over the donor's original cost basis (carryover basis) and holding period. If your uncle bought stock at $20 and gives it to you when it's worth $80, your basis is $20 and any gain above that is taxable when you sell. However, if the stock declined in value below the donor's basis at the time of the gift, different rules apply to losses — this is a complex area where the direction of price movement at the time of the gift matters significantly.
RSUs, ISOs, and NQSOs: Employee Stock Complexity
Employee equity compensation has unique tax treatment. Restricted stock units (RSUs) are taxed as ordinary income when they vest — at vesting, the market value becomes your cost basis. Any subsequent gain from basis to sale is capital gain. Non-qualified stock options (NQSOs) create ordinary income equal to the spread (market price minus exercise price) when exercised, with the exercise price plus income recognized becoming your basis. Incentive stock options (ISOs) are more complex and may trigger Alternative Minimum Tax at exercise. If you're holding significant unvested equity, consider the long-term vs. short-term capital gains guide for planning the timing of any sales post-vesting.
State Capital Gains Tax on Stock Sales
Most states tax capital gains as ordinary income at the state's regular income tax rates. Nine states have no income tax at all (Alaska, Florida, Nevada, New Hampshire, South Dakota, Tennessee, Texas, Washington, and Wyoming) — making them particularly attractive for investors planning large liquidation events. California stands at the other extreme: the state taxes all capital gains at ordinary income rates up to 13.3%, with no preferential long-term rate. Combined with the 23.8% federal rate (20% + 3.8% NIIT), a California high earner selling long-held stock pays 37.1% in combined federal and state capital gains taxes.
Frequently Asked Questions
Do I owe taxes if I sell stock at a loss?
No — you don't owe capital gains tax on a loss, and you may actually benefit from it. Capital losses offset capital gains dollar-for-dollar. If net losses exceed gains, you can deduct up to $3,000 against ordinary income this year and carry the remaining loss forward to future tax years indefinitely.
When do I owe capital gains tax — when I sell or when I file?
The taxable event occurs when you sell (or the settlement date). But you actually pay the tax when you file your return, or through quarterly estimated payments during the year if your total tax liability will exceed $1,000 due to the gains. Brokers don't withhold taxes on stock sales the way employers withhold from wages.
How do I avoid capital gains tax when selling stock?
Strategies include: holding positions over one year for long-term rates, harvesting losses to offset gains, donating appreciated shares to charity instead of selling (you avoid the gain entirely and deduct the full market value), using tax-advantaged accounts like IRAs for higher-turnover investments, and strategically managing income to stay in the 0% bracket.
What if I sell stock and don't report it?
Your broker sends Form 1099-B directly to the IRS with your proceeds. The IRS's automated matching program compares 1099-Bs to filed returns and flags discrepancies. Non-reporting results in IRS notices, back taxes, accuracy penalties (20%), and interest. In egregious cases, criminal penalties apply.
Does selling stock count as income for FAFSA or financial aid?
Yes. Capital gains from stock sales appear on your tax return as income and are counted in the FAFSA formula. A large stock sale in the year before a financial aid application can significantly reduce need-based aid eligibility. Timing large liquidations is especially important for families with college-bound students.
What is the tax rate on selling ETF or mutual fund shares?
The same long-term/short-term rules apply. If you hold an ETF for over one year and sell at a gain, the preferential 0%, 15%, or 20% rates apply. However, mutual funds may also distribute capital gains internally at year-end, which are taxable even if you didn't sell — ETFs are generally more tax-efficient due to their in-kind redemption mechanism that rarely triggers internal distributions.
Calculate Your Capital Gains Tax
Enter your income, holding period, and gain amount to see exactly what you'll owe federally — plus state tax estimates.