U.S. stocks are taxed on two events: the dividends you receive and the gains you realize when you sell. Dividends are taxed either at your ordinary income rate or, if they qualify, at the lower long-term capital gains rates of 0%, 15%, or 20%. Sale profits follow the same split: shares held a year or less are taxed at ordinary rates, and shares held longer get the 0/15/20 treatment. Higher earners pay an extra 3.8% surtax on top. Everything below explains how those pieces fit together and where the traps are.
Dividends
Ordinary dividends are taxed at your regular income tax rate, which for 2026 ranges from 10% to 37%. Qualified dividends get the long-term capital gains rates of 0%, 15%, or 20% depending on your taxable income.1Internal Revenue Service. Topic No. 404, Dividends and Other Corporate Distributions
A dividend only counts as qualified if you held the stock long enough. You need to have owned the shares for more than 60 days during the 121-day window that starts 60 days before the ex-dividend date. Preferred stock paying dividends that cover periods totaling more than 366 days uses a longer test: more than 90 days within a 181-day window.2Internal Revenue Service. Publication 550, Investment Income and Expenses Buy right before a dividend, sell shortly after, and the payout gets taxed at your ordinary rate.
Dividends from Real Estate Investment Trusts don’t qualify for the capital gains rates. They’re ordinary income. Section 199A lets you deduct up to 20% of qualified REIT dividends from your taxable income without itemizing, which softens the higher rate.3Office of the Law Revision Counsel. 26 USC 199A – Qualified Business Income The deduction goes on Form 8995, and the underlying dividend amount appears in Box 5 of your Form 1099-DIV.
Capital Gains When You Sell
Sell shares for more than you paid, and the profit is a capital gain. The holding period sets the rate.
Held one year or less: short-term. Taxed at your ordinary income rate, up to 37% in 2026. Every profitable trade inside that one-year window is fully exposed to your bracket.4Internal Revenue Service. Topic No. 409, Capital Gains and Losses
Held more than one year: long-term. Taxed at 0%, 15%, or 20% based on taxable income. For 2026, single filers pay 0% on long-term gains up to $49,450 of taxable income, 15% up to $545,500, and 20% above that. Married couples filing jointly hit 15% at $98,900 and 20% at $613,700. The thresholds move with inflation each year.
The 3.8% Net Investment Income Tax
On top of the standard rates, a 3.8% surtax hits net investment income for higher earners: modified adjusted gross income above $200,000 (single) or $250,000 (married filing jointly). Those thresholds aren’t indexed to inflation, so more taxpayers cross them each year.5Internal Revenue Service. Net Investment Income Tax Stacked on the 20% long-term rate, the effective federal ceiling on long-term gains reaches 23.8%.
Losses, Netting, and the Wash Sale Rule
Losses first offset gains of the same type: short against short, long against long. Any remaining net loss in one category then offsets gains in the other. If total losses still exceed total gains, you can deduct up to $3,000 of the excess against ordinary income ($1,500 if married filing separately).6Office of the Law Revision Counsel. 26 USC 1211 – Limitation on Capital Losses Anything past that carries forward indefinitely, keeping its short- or long-term character.7Office of the Law Revision Counsel. 26 USC 1212 – Capital Loss Carrybacks and Carryovers
The $3,000 cap matters more than it sounds. A $30,000 net loss would take a decade of carryforwards to fully use if no offsetting gains show up along the way.
The wash sale rule blocks a common shortcut. Sell a stock at a loss, then buy the same or a substantially identical security within 30 days before or after the sale, and the IRS disallows that loss.8Office of the Law Revision Counsel. 26 USC 1091 – Loss From Wash Sales of Stock or Securities The disallowed amount is added to the basis of the replacement shares, and the original holding period tacks on, so the loss is deferred rather than erased.
One exception costs people money. If the replacement purchase happens inside an IRA or Roth IRA, the basis in the IRA isn’t increased, so the disallowed loss is effectively forfeited. The rule also spans all your accounts, including a spouse’s accounts, even though brokerages only track wash sales within one account and CUSIP. Cross-account tracking is on you.
Cost Basis
Your cost basis is what you paid, including commissions and fees. It’s the starting point for every gain or loss calculation, and it’s where reporting errors quietly grow.
If you bought the same stock at different times and prices, a method decides which lot you’re selling. The default at most brokerages is first-in, first-out. Because older shares often carry lower basis, FIFO tends to produce bigger gains. Specific identification lets you pick lots at the time of sale, so you can choose higher-basis shares to reduce the taxable gain. You have to designate the lot with your broker at the time of the trade and keep the confirmation.
A stock split isn’t a taxable event. Your total basis stays the same; only the per-share number changes. One hundred shares at $50 becoming two hundred at $25 after a 2-for-1 leaves the $5,000 total basis intact.9Internal Revenue Service. Stocks (Options, Splits, Traders) For covered securities bought after 2011, your broker tracks the adjustment. For older uncovered shares, the recordkeeping is yours.
Shares Held in Retirement Accounts
None of the rates above apply while shares sit inside a traditional IRA, Roth IRA, or employer plan like a 401(k). Dividends and gains inside the account trigger no current tax.
In a traditional IRA or 401(k), tax hits on withdrawal, and the full withdrawal is ordinary income regardless of whether the underlying growth was short- or long-term. In a Roth IRA, qualified withdrawals are tax-free because contributions went in after tax.10Internal Revenue Service. Roth IRAs One consequence worth knowing: a dividend that would have qualified for a 15% rate in a taxable brokerage account gets converted to ordinary income when it eventually comes out of a traditional IRA.
Estimated Tax After a Big Sale
If you sell at a large gain and your paycheck withholding won’t cover the resulting tax, the IRS expects a quarterly estimated payment. Deadlines for 2026 are April 15, June 15, September 15, and January 15, 2027.11Internal Revenue Service. Estimated Tax for Individuals
You avoid an underpayment penalty by meeting a safe harbor: 90% of the current year’s tax, or 100% of last year’s tax (110% if your prior-year AGI exceeded $150,000, or $75,000 if married filing separately). You also avoid the penalty if you’ll owe less than $1,000 after withholding and credits.12Office of the Law Revision Counsel. 26 USC 6654 – Failure by Individual to Pay Estimated Income Tax Investors who don’t sell often are the ones who get caught: years of holding, one big sale, and a tax bill nothing on the W-2 side was ever going to cover.
Forms and Deadlines
Your brokerage sends the paperwork by mid-February. Form 1099-DIV reports dividend income of $10 or more, with total ordinary dividends in Box 1a, the qualified portion in Box 1b, and Section 199A REIT dividends in Box 5.13Internal Revenue Service. Instructions for Form 1099-DIV Form 1099-B reports stock sale proceeds, dates, and cost basis for covered securities.14Internal Revenue Service. Instructions for Form 1099-B
Each sale lists on Form 8949, split into short-term and long-term sections.15Internal Revenue Service. Instructions for Form 8949 Totals flow to Schedule D, which computes your net capital gain or loss.16Internal Revenue Service. Instructions for Schedule D (Form 1040), Capital Gains and Losses If every transaction was reported with correct basis and you have no adjustments, you can skip Form 8949 and enter the totals directly on Schedule D.
The 2025 return and any tax owed are due April 15, 2026.17Internal Revenue Service. When to File Form 4868 gives you six more months to file but not to pay; interest and the failure-to-pay penalty of 0.5% per month (capped at 25%) apply to anything unpaid after April 15.18Internal Revenue Service. Failure to Pay Penalty
State Tax
Federal is only part of the bill. Most states tax capital gains and dividends, and roughly 40 of them tax capital gains at ordinary income rates. A handful apply reduced rates to long-term gains, and about seven states have no individual income tax at all. Rates on investment income run from under 2% at the low end to over 13% at the high end. In a high-tax state, the combined federal and state rate on short-term gains can top 45%.
Nonresident Investors
Foreign investors follow a different regime. Dividends from U.S. companies paid to nonresident aliens are subject to a flat 30% withholding on the gross amount, applied by the brokerage before the money hits the account.19Office of the Law Revision Counsel. 26 USC 871 – Tax on Nonresident Alien Individuals Tax treaties often reduce that rate, sometimes to 15% or lower, but only if a valid Form W-8BEN is on file with the broker.20Internal Revenue Service. Instructions for Form W-8BEN Without one, withholding stays at 30%.
Capital gains on U.S. stocks are generally not taxed for nonresidents. The exception: physical presence in the United States for 183 days or more during the tax year triggers a flat 30% tax on net U.S.-source capital gains, even for transactions executed while abroad.21Internal Revenue Service. The Taxation of Capital Gains of Nonresident Students, Scholars and Employees of Foreign Governments