Do You Pay Medicare Tax on Capital Gains? The 3.8% NIIT Explained

No, capital gains are not subject to the 1.45% Medicare payroll tax, but that isn’t the end of the story. If your income is high enough, you may owe a separate 3.8% Net Investment Income Tax on your capital gains. So the honest answer to whether you pay Medicare tax on capital gains is: not the payroll version everyone knows, but possibly a related surtax that was created to fund health care and works a lot like one.

The threshold for that surtax is $200,000 in modified adjusted gross income if you’re single, or $250,000 if you’re married filing jointly. Below those numbers, capital gains carry no Medicare-related tax at all. Above them, an extra 3.8% stacks on top of whatever capital gains rate you already owe.

Why the Payroll Medicare Tax Doesn’t Apply

The 1.45% Medicare tax under FICA is a tax on wages and self-employment earnings.1Internal Revenue Service. Topic No. 751, Social Security and Medicare Withholding Rates It applies to compensation for work performed. Selling a stock, a bond, a mutual fund, or a rental property is not compensation for work, so no FICA tax attaches to the gain. A $500 sale and a $5 million sale are treated identically for payroll tax purposes: zero.

The 0.9% Additional Medicare Tax that high earners pay on wages above $200,000 single or $250,000 joint likewise applies only to wages and self-employment income, not to investment profits.2Internal Revenue Service. Questions and Answers for the Additional Medicare Tax The tax that does reach capital gains is a different one, sitting on your Form 1040 rather than your paystub.

The 3.8% Net Investment Income Tax

The Net Investment Income Tax, or NIIT, is a 3.8% surcharge enacted in 2010 as part of the Affordable Care Act. It applies to individuals, estates, and trusts with income above set thresholds.3Internal Revenue Service. Topic No. 559, Net Investment Income Tax For most investors, capital gains are the largest piece of income that falls within its reach.

The NIIT stacks on top of your regular capital gains rate. Long-term rates run from 0% to 20% depending on your taxable income and holding period. A high-income taxpayer in the 20% long-term bracket who also owes the NIIT pays 23.8% federal tax on those gains.

The income thresholds are fixed by statute and not indexed for inflation.4Internal Revenue Service. Questions and Answers on the Net Investment Income Tax They have been the same dollar amounts since 2013, so more taxpayers cross them every year.

Who Actually Owes It

The NIIT kicks in only when your Modified Adjusted Gross Income exceeds the threshold for your filing status. MAGI is generally your AGI plus any foreign earned income you excluded. The thresholds are:

  • Single or head of household: $200,000
  • Married filing jointly or qualifying surviving spouse: $250,000
  • Married filing separately: $125,000
3Internal Revenue Service. Topic No. 559, Net Investment Income Tax

Both pieces have to be present for the tax to apply: income above the threshold, and investment income to tax. A retiree living entirely on Social Security and a modest pension who sells a small stock position won’t owe it. Neither will a highly paid executive whose entire income is salary with no investment sales that year.

How the NIIT Is Calculated

The tax equals 3.8% of the lesser of two figures: your total net investment income, or the amount by which your MAGI exceeds your threshold. That “lesser of” rule is the whole mechanism, and it keeps the tax from reaching wage income.

A single filer with $210,000 MAGI and $30,000 in net investment income exceeds the $200,000 threshold by $10,000. The tax applies to the smaller number: $10,000 × 3.8% = $380.

A married couple with $300,000 MAGI and $15,000 in net investment income exceeds their $250,000 threshold by $50,000, but their investment income is only $15,000. The tax applies to $15,000, producing $570.5Office of the Law Revision Counsel. 26 USC 1411 – Imposition of Tax

Net investment income includes both short-term and long-term capital gains, along with interest, dividends, annuities, royalties, rents, and income from passive business activities.5Office of the Law Revision Counsel. 26 USC 1411 – Imposition of Tax For capital gains specifically, the tax reaches profits from stocks, mutual funds, bonds, and investment real estate, plus gains from selling a partnership interest or S-corporation shares if you were a passive investor.

You can reduce gross investment income by certain related deductions, including investment interest expense and properly allocated state and local taxes tied to that income.6Internal Revenue Service. 2025 Instructions for Form 8960

Capital Gains That Escape the Tax

Several categories of investment income are removed from the NIIT calculation, even for taxpayers well above the thresholds.

Retirement account distributions. Money coming out of a 401(k), traditional or Roth IRA, 403(b), or 457(b) plan does not count as net investment income, even when the distribution consists entirely of decades of accumulated gains.5Office of the Law Revision Counsel. 26 USC 1411 – Imposition of Tax This is a real advantage of holding investments inside retirement accounts for high earners.

Primary residence sales. The standard home-sale exclusion applies before the NIIT, so the first $250,000 of gain on your main home (single) or $500,000 (married filing jointly) is not investment income.4Internal Revenue Service. Questions and Answers on the Net Investment Income Tax Only gain above those limits enters the calculation. For most home sales, the 3.8% tax simply does not touch the profit.7Internal Revenue Service. Topic No. 701, Sale of Your Home

Tax-exempt interest. Municipal bond interest is excluded from net investment income because it is already exempt from federal income tax.4Internal Revenue Service. Questions and Answers on the Net Investment Income Tax Note that it can still raise your MAGI in some calculations.

Active business income. Income from a trade or business you actively participate in is excluded because it is already subject to payroll or self-employment tax. The NIIT was built to capture passive investment income that would otherwise pay no payroll-type tax at all.

Ways to Reduce What You Owe

Since the calculation depends on two numbers, your net investment income and your MAGI, planning generally targets one or both.

Harvesting capital losses is the most direct move. Losses offset gains dollar for dollar, and up to $3,000 of excess loss can offset ordinary income each year, with the rest carrying forward.8Internal Revenue Service. Topic No. 409, Capital Gains and Losses Spreading a large planned gain across two tax years, rather than realizing all of it in one, can keep MAGI below the threshold in each year.

Contributions to tax-deferred retirement accounts lower AGI, which lowers MAGI. The account also shelters future gains from the NIIT because retirement distributions are excluded from net investment income.

Charitable giving works on both variables at once. Donating appreciated stock directly to a charity or donor-advised fund avoids realizing the gain in the first place, and the deduction lowers MAGI.

How to Report and Pay It

The NIIT is reported on IRS Form 8960, which calculates net investment income, applies the MAGI threshold, and produces the 3.8% figure that carries to your Form 1040.9Internal Revenue Service. Net Investment Income Tax Any individual, estate, or trust that owes the tax must file the form.10Internal Revenue Service. Form 8960 – Net Investment Income Tax

Unlike the Medicare payroll tax, no one withholds the NIIT for you. Investors who expect to owe it usually handle it through quarterly estimated tax payments. The IRS generally requires estimated payments if you expect to owe $1,000 or more after withholding and credits.11Internal Revenue Service. Estimated Tax – Individuals

If a big capital gain hits early in the year, adjust that quarter’s estimated payment rather than waiting. Underpayment penalties are assessed quarter by quarter, so a January sale ignored until the April estimated payment can still generate a first-quarter penalty.12Internal Revenue Service. Topic No. 306, Penalty for Underpayment of Estimated Tax

Taxpayers whose prior-year AGI topped $150,000 ($75,000 married filing separately) face a higher safe harbor: estimated payments must cover at least 110% of the prior year’s total tax to avoid penalties. For investors whose income swings from year to year, that 110% rule often sets the payment amount more than any current-year projection does.