Tax & WithholdingVerified

Capital Gains Tax Calculator

Calculate the tax owed on capital gains from the sale of investments, stocks, real estate, and other assets.

capital-gains-tax.calculatorready

Capital gains tax applies when you sell investments, real estate, or other assets for more than you paid. Understanding how capital gains are calculated and taxed is essential for investors seeking to maximize after-tax returns. The tax treatment differs dramatically based on how long you held the asset, your income level, and the type of asset sold. Whether you're trading stocks, selling investment property, or planning retirement distributions, mastering capital gains tax helps you time sales strategically, minimize tax obligations, and keep more of your investment profits.

Net Investment Income Tax (NIIT)

The Net Investment Income Tax adds 3.8% to investment income including capital gains for high earners, significantly increasing the effective tax rate.

NIIT applies to the lesser of net investment income or the amount by which modified adjusted gross income (MAGI) exceeds $200,000 (single), $250,000 (married filing jointly), or $125,000 (married filing separately). Investment income includes interest, dividends, capital gains, rental income, and passive business income, but excludes wages, self-employment income, and distributions from qualified retirement plans.

Calculate NIIT on the overlap between your net investment income and the amount your MAGI exceeds the threshold. A single filer with $240,000 MAGI including $60,000 in capital gains pays NIIT on $40,000 (the amount exceeding $200,000), resulting in $1,520 in additional tax ($40,000 × 0.038).

If your MAGI is $220,000 (single) with $10,000 in capital gains, you pay NIIT only on the $10,000 of investment income (not the full $20,000 excess over threshold), costing $380. The NIIT applies to the lesser of investment income or excess MAGI.

For high earners, NIIT effectively raises the long-term capital gains rate from 15% to 18.8% or from 20% to 23.8%. Combined with state taxes, this creates substantial tax burdens on investment income. California residents face federal rates of 23.8% plus 13.3% state tax, totaling 37.1% on long-term capital gains.

Strategies to minimize NIIT include managing income to stay below thresholds (perhaps spreading asset sales across multiple years), maximizing deductions to reduce MAGI, and using tax-advantaged accounts like IRAs and 401(k)s where gains aren't subject to NIIT.

Related Calculators

Tax

Income Tax Calculator

Estimate your federal income tax liability based on your income, filing status, deductions, and credits for the current tax year.

Open calculator
Tax

Tax Bracket Calculator

Determine your federal tax bracket and see how your income is taxed across all brackets based on your filing status.

Open calculator
Investment & Retirement

Capital Gains Calculator

Calculate your capital gains tax liability on investment profits, distinguishing between short-term and long-term holding periods.

Open calculator