The return you see on a brokerage statement and the return you actually keep are two different numbers, and the gap between them is almost entirely a function of decisions you control - when you sell, which shares you sell, and what account they sit in - not decisions the market makes for you.
Most investors spend far more time thinking about which stock to buy than about how the sale will be taxed. That's backwards. For a taxable investor in a high bracket, the difference between a short-term and a long-term gain can be worth more than the difference between a good stock pick and an average one. Taxes are one of the few variables in investing that are fully within your control, and unlike market timing, the rules are written down in advance.
This guide walks through how capital gains are actually taxed, the mechanics that let you choose which shares get sold, how dividends are taxed differently from capital gains, and the higher-level tools - stepped-up basis, opportunity zones, trader tax status - that shape after-tax returns for different kinds of investors. None of this is a substitute for a CPA who knows your full picture, but it's the vocabulary and the levers you need to have that conversation productively.
Note: This is educational content, not tax advice. Tax law changes, brackets are adjusted annually for inflation, and your specific situation may differ. Consult a qualified tax professional before making decisions based on this article.
Short-Term vs. Long-Term: The Single Biggest Lever You Control
The IRS draws one hard line that determines how a capital gain is taxed: did you hold the position for more than one year?
- Short-term capital gain — held one year or less, taxed as ordinary income at your marginal tax rate.
- Long-term capital gain — held more than one year, taxed at preferential rates of 0%, 15%, or 20%.
The holding period clock starts the day after you buy and includes the day you sell. Selling at exactly 365 days (366 in a leap year) is still short-term. This is a real trap: investors routinely sell a winning position a few days too early, converting what would have been a 15% tax event into a 32% or 35% one, purely because they didn't check the purchase date.
2025 Long-Term Capital Gains Brackets
| Filing Status | 0% Rate | 15% Rate | 20% Rate |
|---|---|---|---|
| Single | Taxable income up to $48,350 | $48,351 – $533,400 | Above $533,400 |
| Married Filing Jointly | Up to $96,700 | $96,701 – $600,050 | Above $600,050 |
These thresholds are indexed for inflation and adjusted by the IRS each year, so confirm the current-year numbers before relying on them for planning purposes — the brackets shown are for the 2025 tax year.
Short-Term Gains Are Taxed at Ordinary Rates
Short-term gains stack on top of your other income and are taxed at the same brackets as your salary — up to 37% federally at the top bracket, before state tax. The gap between short-term and long-term treatment widens sharply as income rises:
| Income Level (Single Filer, 2025) | Short-Term Rate | Long-Term Rate | Gap |
|---|---|---|---|
| $47,026 – $100,525 | 22% | 15% | 7 pts |
| $100,526 – $191,950 | 24% | 15% | 9 pts |
| $191,951 – $243,725 | 32% | 15% | 17 pts |
| $243,726 – $609,350 | 35% | 20% | 15 pts |
| Over $609,350 | 37% | 20% | 17 pts |
On a $50,000 gain, a trader in the 32% bracket pays $16,000 in federal tax if the position is short-term versus $7,500 if it qualifies as long-term — a $8,500 difference for waiting out a holding period, with the stock's price unchanged.
The Net Investment Income Tax (NIIT)
On top of ordinary capital gains rates, a 3.8% Net Investment Income Tax applies to investment income — including capital gains, dividends, and interest — once modified adjusted gross income exceeds $200,000 (single) or $250,000 (married filing jointly). Unlike the capital gains brackets, these thresholds are fixed in the statute and are not indexed for inflation, so more investors cross them every year as incomes rise. For an investor already near the threshold, timing a large gain matters — realizing it in a year with lower other income can keep the NIIT from applying at all.
Specific Lot Identification: Choosing Which Shares You Sell
If you've bought the same stock multiple times at different prices, your broker needs to know which shares you're selling when you place a sell order for less than your full position. By default, most brokers use FIFO (first in, first out) — the oldest shares are sold first.
FIFO isn't always the best choice. If you bought a stock at $40, then again at $90, then again at $60, and the stock now trades at $100, FIFO sells your $40 lot first — the largest possible taxable gain. Specific lot identification lets you instead choose to sell the $90 lot, minimizing the gain (or realizing a loss, if the current price is below that lot's basis).
FIFO vs. Specific Lot ID: A Worked Example
Suppose you own 300 shares of the same stock across three lots and want to sell 100 shares at a current price of $100:
| Lot | Shares | Cost Basis | Gain if Sold (FIFO order) | Gain if Sold (Specific ID: highest cost) |
|---|---|---|---|---|
| Lot 1 (oldest) | 100 | $40/share | $6,000 gain | — |
| Lot 2 | 100 | $90/share | — | $1,000 gain |
| Lot 3 (newest) | 100 | $60/share | — | — |
Selling under default FIFO rules realizes a $6,000 gain. Selecting Lot 2 through specific identification realizes only a $1,000 gain on the same 100 shares at the same sale price — a strategy sometimes called HIFO (highest in, first out) when it's applied systematically across a portfolio.
How to use it: You must select the lot at the time you place the trade, not after settlement — most broker platforms have a "tax lot" or "cost basis method" selector at order entry. Set your account's default cost basis method to "specific identification" so you have the option every time, rather than defaulting to FIFO and losing the choice.
Qualified Dividends vs. Ordinary Dividends
Not all dividend income is taxed the same way, and the distinction is worth more attention than most investors give it.
Qualified dividends are taxed at the same preferential 0%/15%/20% rates as long-term capital gains. To qualify, a dividend generally must:
- Be paid by a U.S. corporation or a qualifying foreign company
- Be held for more than 60 days during the 121-day period that begins 60 days before the ex-dividend date
Ordinary (non-qualified) dividends are taxed at your regular marginal income tax rate — the same as short-term gains. Common sources of ordinary dividend income include:
- Most REIT distributions (though a portion may qualify for the Section 199A 20% pass-through deduction, which effectively lowers the top rate on that portion)
- Dividends from money market funds and most bond funds
- Dividends on stock held for 60 days or less around the ex-dividend date
The practical takeaway: if you're trading in and out of dividend-paying stocks around the ex-dividend date to capture the payout, you may be converting what looks like a dividend into ordinary income tax treatment simply by not holding long enough. For a buy-and-hold position you already intend to keep for months or years, this rarely matters — but for anyone actively trading around dividend dates, it's a cost that's easy to miss until the 1099-DIV arrives.
Stepped-Up Basis: The Most Powerful (and Least Discussed) Provision
When an investor dies holding an appreciated stock, the heir who inherits it does not inherit the original cost basis — they inherit a basis reset to the security's fair market value on the date of death (or, if the estate elects it, an alternate valuation date six months later).
Why this matters: all of the unrealized capital gain that accumulated during the original owner's lifetime simply disappears for tax purposes.
Example: An investor buys a stock at $10/share decades ago. By the time they die, it's worth $200/share — an $190/share unrealized gain that would have triggered a substantial capital gains bill if sold during their lifetime. Their heir inherits the shares with a stepped-up basis of $200/share. If the heir sells the next day at $200, there is no capital gain, and no tax owed on that appreciation at all.
This is one of the most consequential — and most debated — provisions in the tax code for long-term investors thinking about estate planning. It creates a strong incentive to hold highly appreciated, low-basis positions rather than sell them during your lifetime if the goal is to pass wealth to heirs, since selling triggers a tax bill that simply holding until death avoids entirely. In community property states, married couples can receive a "double step-up" on the full value of jointly held community property when the first spouse dies, not just the deceased spouse's half.
This provision has been the subject of repeated reform proposals over the years (including proposals to tax unrealized gains at death above an exemption amount). Current status can change with new legislation, so anyone doing serious estate planning around appreciated positions should confirm the rule is still in effect and work with an estate attorney.
Why 1031 Exchanges Don't Work for Stocks
Real estate investors are familiar with Section 1031 like-kind exchanges — selling an investment property and rolling the proceeds into a replacement property without recognizing the capital gain, as long as IRS timing and structuring rules are followed.
Stock investors sometimes assume there's an equivalent. There isn't. Section 1031 has never applied to stocks, bonds, or other securities — the code explicitly excludes them, and the 2017 tax law that narrowed 1031 treatment to real property only reinforced a distinction that already existed for securities.
If you're a real estate investor also holding securities and considering diversifying real estate gains into stocks (or vice versa), there is no way to defer that gain through a like-kind exchange. The tools available to defer or reduce tax on appreciated securities are different:
- Tax-loss harvesting — realizing losses elsewhere in the portfolio to offset the gain (see our wash sale rule guide for the mechanics and traps)
- Qualified Opportunity Zone (QOZ) funds — covered below
- Charitable giving of appreciated stock — donating shares directly to a charity or donor-advised fund avoids the capital gains tax entirely while still generating a fair-market-value income tax deduction, versus selling first and donating cash
- Simply holding past the one-year mark to convert a short-term gain into a long-term one
One structure worth knowing if you hold real estate through a partnership: a 721 exchange (UPREIT transaction) lets a property owner contribute real estate directly into a REIT's operating partnership in exchange for operating partnership units, deferring gain recognition similarly to a 1031 exchange. It's a real estate-specific mechanism, not something available to a stock portfolio, but it's the closest real estate/REIT-adjacent analog to a like-kind exchange that some investors confuse with 1031 treatment on securities.
Qualified Opportunity Zones: Deferring Gains on Any Asset
Unlike 1031 exchanges, Qualified Opportunity Zone (QOZ) investing is available for gains from the sale of any asset — including stocks — not just real estate.
The basic mechanic:
- Realize a capital gain from selling any asset (stock, business, real estate)
- Reinvest the gain amount into a Qualified Opportunity Fund within 180 days
- Defer tax on the original gain
- If the QOZ investment is held for 10 years, any appreciation on the new QOZ investment itself is permanently excluded from capital gains tax
This is meaningfully different from 1031 — you're not exchanging like-kind assets, you're redeploying a realized gain of any kind into a designated fund investing in economically distressed areas, in exchange for deferral and, after a full 10-year hold, tax-free appreciation on the new investment.
Opportunity Zones were created in the 2017 tax law and have gone through subsequent legislative changes, including efforts to make the designation program permanent with rolling zone re-designations. Because the program's specific rules and deadlines have shifted since its creation, confirm current QOZ fund eligibility, deadlines, and the specific benefits in effect with a tax advisor before treating this as a firm plan — this is a strategy where the details genuinely change year to year.
How Active Traders and Institutions Think About Tax Cost
Investors who trade frequently face a structurally different tax picture than buy-and-hold investors, and some have tools built specifically for that reality.
Section 1256 contracts — including regulated futures contracts and broad-based index options (like SPX options, as opposed to single-stock options) — get automatic 60/40 tax treatment: 60% of any gain is taxed at long-term rates and 40% at short-term rates, regardless of how long the position was actually held. A day-trader in SPX options gets meaningfully better tax treatment on those specific instruments than a day-trader in individual stock options, purely because of the contract type.
Trader Tax Status (TTS) and the Section 475(f) mark-to-market election let investors who trade with enough frequency and continuity to qualify as a "trader" (rather than an "investor") for tax purposes elect mark-to-market accounting. This treats all open positions as sold at fair market value on the last trading day of the year and converts all gains and losses to ordinary income and loss — which sounds worse than capital gains treatment, but has two major upsides for high-frequency traders: it eliminates wash sale rule concerns entirely, and it allows unlimited ordinary loss deductions instead of the $3,000/year capital loss limit against other income. The tradeoff is giving up the 0%/15%/20% preferential rates on what would have been long-term gains — which is why the election tends to make sense for traders whose gains are mostly short-term anyway, and rarely for buy-and-hold investors.
The election must generally be filed by the tax filing deadline (without extensions) of the year before it's meant to apply, which means it requires planning ahead rather than a decision made at year-end.
Turning Tax Awareness Into a Repeatable Process
Most of the tax cost investors pay isn't from bad decisions — it's from decisions made without the tax consequence in view at the moment of the trade. A few habits close most of that gap:
- Know your holding period before you sell. If a position is within a few weeks of the one-year mark and the thesis hasn't changed, waiting can be worth more after-tax than the risk of holding a few extra weeks costs you. Track purchase dates directly against today's date rather than trusting memory.
- Default your account to specific lot identification, not FIFO, so you always have the choice of which lot to sell rather than losing the option after the fact.
- Match asset location to tax efficiency. Tax-inefficient holdings — high-turnover strategies, taxable bonds, REITs generating ordinary dividend income — belong in tax-advantaged accounts (401(k), IRA) where possible. Tax-efficient holdings, like individual stocks intended to be held long-term, are better suited to a taxable account.
- Review unrealized losses before year-end, not just in December — losses realized earlier in the year create more flexibility to redeploy capital and avoid crowding into the same December harvesting trades everyone else makes.
Using alerts to stay ahead of the calendar: the hardest part of tax-aware investing isn't understanding the rules — it's remembering to act on them at the right moment, for the right position, out of dozens of holdings. Stock Alarm Pro's alerts can flag a position that's down a meaningful percentage from your cost basis (a harvesting candidate), or simply help you keep the dashboard in front of you so a position approaching its one-year anniversary doesn't get sold a few days too early by accident. Pairing tax awareness with a real-time watchlist turns a once-a-year scramble into an ongoing, repeatable process.
Ready to manage your positions with tax timing in view? Start free with Stock Alarm — real-time price alerts, a full screener across 10,000+ stocks, and a dashboard built to keep every holding's cost basis and timeline in view. No credit card required.
Related Articles
- Wash Sale Rule Explained: What Every Investor Needs to Know
- Tax-Loss Harvesting Guide for Active Traders
- Dividend Investing Guide
- Ex-Dividend Date Explained
Disclaimer: This article is for educational purposes only and does not constitute tax or investment advice. Tax rates, thresholds, and rules referenced here (including capital gains brackets and Opportunity Zone provisions) are subject to change and are adjusted or amended by Congress and the IRS over time. Always consult a qualified tax professional or CPA about your specific situation before making decisions based on this content.