You hold a mutual fund all year, never sell a single share, and then a 1099-DIV arrives showing a taxable capital gain distribution you never asked for. That scenario catches more investors off guard than any rate table. Stock market taxes on capital gains and dividends go well beyond the headline rates, and the details that actually raise your bill tend to hide in fund distributions, wash-sale traps, and income surtaxes.
Fund distributions and capital gains tax you did not trigger
Most guides start with the classic short-term versus long-term split. That matters, but it assumes you chose when to sell. A mutual fund can create a taxable capital gain even when you never sell shares. When a fund manager inside the portfolio realizes gains by selling appreciated holdings, the fund passes those gains through to every shareholder as a capital-gain distribution.
Read also: Earnings season and the numbers that move U.S. stocks
The IRS treats these distributions as long-term gains regardless of how long you personally held the fund. Reinvesting the distribution does not make it tax-free. You owe federal tax on the payout the same year it posts, even if the fund’s share price dropped.
The same mechanism applies to REITs. If you own a real estate investment trust in a taxable brokerage account, the trust’s internal sales can generate distributions taxed at capital gains rates, or in some cases at ordinary income rates, depending on the character of the trust’s underlying activity.
You may also like: Stock buybacks and what they mean for shareholders

Ordinary dividends disguised inside a fund
Not every fund payout labeled “dividend” qualifies for the lower tax rates. When a fund’s net short-term capital gains are passed to shareholders, those gains are reported as ordinary dividends, not as capital gains. The practical result: a distribution that looks like a dividend on your statement can be taxed at your full ordinary income rate instead of the preferential rates reserved for qualified dividends or long-term gains.
Checking box 1a versus box 1b on your 1099-DIV is the only reliable way to tell them apart. Qualified dividends and ordinary dividends are taxed at very different rates.
Wash-sale rule across IRA and brokerage accounts
Selling a losing stock to harvest the loss, then buying back a substantially identical security within 30 days before or after the sale, triggers the wash-sale rule and disallows the loss. Most investors know this applies inside a single brokerage account.
What trips people up is that the IRS extends the wash-sale restriction to purchases made in an IRA. If you sell a stock at a loss in a taxable account and buy the same stock within the 30-day window inside your traditional or Roth IRA, the loss is disallowed and cannot be added to the IRA’s cost basis. Publication 550 from the IRS spells this out, yet many brokers do not automatically track cross-account wash sales.
The practical damage is real. The capital loss vanishes entirely. Unlike a standard wash sale in one taxable account, where the disallowed loss gets added to the replacement stock’s basis, a purchase in an IRA offers no basis adjustment. The deduction is simply gone.
Steps to avoid a cross-account wash sale
- Wait the full 31 days after selling a losing position in your taxable account before buying anything substantially identical in any IRA or Roth IRA you own.
- Avoid automatic dividend reinvestment in an IRA for any security you are simultaneously loss-harvesting in a taxable account.
- Use a different, non-identical ETF or fund in the IRA if you need market exposure during the waiting period, making sure the replacement is not substantially identical under IRS criteria.
Net Investment Income Tax and the MAGI threshold
Federal capital gains rates of 0%, 15%, or 20% get the most attention. A less-discussed layer is the 3.8% Net Investment Income Tax (NIIT), which applies on top of whatever capital gains or dividend rate you already owe.
The NIIT hits the lesser of your net investment income or the amount by which your modified adjusted gross income (MAGI) exceeds the statutory threshold for your filing status. The NIIT thresholds are not indexed to inflation, which means that over time, filers who were once well below the cutoff can cross it without any real increase in purchasing power.
Investment income subject to the NIIT includes capital gains, dividends, interest, rental income, and royalties. For an investor with a large realized gain in a single year, perhaps from selling concentrated stock, the effective federal rate on that gain can reach 23.8% when the 20% top bracket and the 3.8% surtax combine.
- Capital gain distributions from mutual funds and REITs count as net investment income for NIIT purposes.
- Gains inside a 401(k) or traditional IRA are not subject to NIIT while they remain in the account, but distributions from those accounts can raise your MAGI and push other investment income above the threshold.
- A Roth IRA conversion in the same year as a large stock sale can stack income and trigger NIIT on gains that would otherwise have stayed below the line.

Short-term vs long-term capital gains tax rates
The basic framework still governs most outcomes. Assets held for one year or less produce short-term gains taxed at ordinary income rates. Assets held longer than one year produce long-term gains taxed at preferential federal rates of 0%, 15%, or 20%, depending on taxable income.
Cost basis is the original purchase price plus any capitalized costs. For inherited assets, IRC Section 1014 generally provides a stepped-up basis to fair market value at the date of death, which can eliminate decades of unrealized appreciation in a single step. Accurate basis records prevent IRS disputes and reduce reportable gains.
Capital losses and the annual deduction limit
Capital losses offset capital gains dollar for dollar. If net losses exceed net gains, the IRS allows a deduction against ordinary income up to a fixed annual cap. Unused losses carry forward indefinitely. This makes loss harvesting a useful tool, but only when the wash-sale rule (including the IRA cross-account trap discussed above) is respected.
Planning stock market taxes with the full picture
Tax planning that stops at “hold for more than a year” misses the factors that actually move the bill. A mutual fund distribution can generate a tax event you never initiated. A wash sale crossing into an IRA can destroy a loss with no recovery.
The NIIT can add a surtax layer that did not exist when the thresholds were set, because those thresholds have never been adjusted for inflation. Reviewing your 1099-DIV line items, coordinating trades across account types, and projecting MAGI before year-end are the concrete steps that keep stock market taxes from exceeding what the rate tables suggest.

