Capital Gains Tax Calculator

Use this Capital Gains Tax Calculator to estimate the federal tax you may owe when you sell an investment for a profit. Enter what you paid for the asset, what you sold it for, your selling costs, holding period, filing status, and taxable income before the gain.

The calculator estimates your capital gain and applies the 2026 federal capital gains rules. It can also account for capital losses and estimate the 3.8% Net Investment Income Tax (NIIT) when applicable.

This calculator is useful for estimating taxes on investments such as stocks, ETFs, mutual funds, and other capital assets. Your actual tax bill can be different depending on deductions, other investments, qualified dividends, special tax rules, state taxes, and the type of asset you sold.

Assets held more than one year generally qualify for long-term capital gain rates.
$
$
$
Include eligible commissions, fees, and other selling expenses.
$
Enter other capital losses you expect to use against this gain.
$
Use taxable income after deductions, before adding this capital gain.
$
Used only to estimate the 3.8% Net Investment Income Tax.
Net Capital Gain
$0
Estimated Capital Gains Tax
$0
Effective Tax Rate
0%
After-Tax Gain
$0

Capital Gain Breakdown

Sale Price $0
Purchase Price $0
Selling Costs $0
Capital Gain Before Losses $0
Other Capital Losses $0
Taxable Capital Gain $0

Tax Estimate

Capital Gains Rate 0%
Estimated Federal Capital Gains Tax $0
Estimated NIIT $0
Total Estimated Tax $0

How Capital Gains Tax Is Calculated

Capital gains tax is generally based on the profit you make when you sell an investment or other capital asset. A simple starting point is the sale price minus your adjusted basis and eligible selling expenses.

For example, if you bought an investment for $25,000 and later sold it for $50,000, you have a $25,000 gain before considering selling costs or other capital losses.

Short-Term vs. Long-Term Capital Gains

The length of time you own an asset can make a significant difference.

Short-term capital gains generally apply when you hold an asset for one year or less. These gains are generally taxed at ordinary federal income tax rates.

Long-term capital gains generally apply when you hold an asset for more than one year. Most long-term gains for individuals are generally subject to the 0%, 15%, or 20% federal capital gains rates, depending on taxable income and filing status.

What Is Your Capital Gain?

A simplified calculation looks like this:

Capital Gain = Sale Price − Purchase Price − Selling Costs

If you have eligible capital losses from other investments, those losses may reduce your net capital gain.

The actual tax calculation can be more complicated because capital gains are generally layered on top of your other taxable income.

2026 Long-Term Capital Gains Rates

For 2026, the main federal long-term capital gains rates for individuals are 0%, 15%, and 20%. The applicable threshold depends on your filing status.

For example, the 0% rate applies up to $49,450 of taxable income for Single filers and Married Filing Separately, $66,200 for Head of Household, and $98,900 for Married Filing Jointly. The 15% rate generally extends up to $545,500, $579,600, and $613,700 respectively.

These thresholds are based on taxable income, not simply your salary or total income.

What Is the 3.8% Net Investment Income Tax?

Some taxpayers with higher modified adjusted gross income may also owe the 3.8% Net Investment Income Tax, commonly called NIIT.

The threshold is generally $200,000 for Single or Head of Household filers, $250,000 for Married Filing Jointly, and $125,000 for Married Filing Separately. The tax applies to the lesser of net investment income or the amount by which MAGI exceeds the applicable threshold.

The calculator includes an optional simplified NIIT estimate.

Capital Gains Tax Examples

Example 1: Long-Term Stock Gain

Suppose you bought stock for $20,000 and sold it for $50,000 after holding it for more than one year. You paid $500 in selling costs.

Your approximate gain is:

$50,000 − $20,000 − $500 = $29,500

If your other taxable income places the gain within the 15% long-term capital gains range, the estimated federal capital gains tax on the gain could be approximately:

$29,500 × 15% = $4,425

The actual tax can be different because capital gains are stacked on top of your other taxable income.

Example 2: Short-Term Investment Gain

Suppose you buy an investment for $10,000 and sell it for $15,000 after eight months.

Your gain is:

$15,000 − $10,000 = $5,000

Because the investment was held for one year or less, the gain is generally treated as short-term and taxed using ordinary income tax rates rather than the preferential long-term capital gains rates.

Example 3: Capital Loss

Suppose you have a $12,000 gain from one investment and a $4,000 loss from another investment.

Your simplified net gain is:

$12,000 − $4,000 = $8,000

Capital losses can offset capital gains, although the rules for using and carrying forward losses can vary depending on your overall tax situation.

What This Calculator Does Not Include

This calculator is designed for a general estimate. It does not fully calculate special situations such as collectibles, qualified small business stock, depreciation-related Section 1250 gain, the sale of a primary residence, inherited property, gifted property, or complex capital-loss carryovers.

It also does not calculate state or local capital gains taxes.

For a tax return, use the appropriate IRS forms and instructions, including Form 8949 and Schedule D when applicable.

Frequently Asked Questions

What is capital gains tax?

Capital gains tax is tax on the profit from selling a capital asset for more than its adjusted basis. Stocks, bonds, mutual funds, and many other investments can generate capital gains.

What is the difference between short-term and long-term capital gains?

Short-term gains generally apply when you hold an asset for one year or less and are generally taxed at ordinary income tax rates. Long-term gains generally apply when you hold an asset for more than one year and may qualify for the 0%, 15%, or 20% federal capital gains rates.

How much capital gains tax will I pay in 2026?

It depends on your taxable income, filing status, size of the gain, whether the gain is short-term or long-term, and other factors. Long-term gains for most individuals are generally subject to 0%, 15%, or 20% federal rates.

Are capital gains taxed as ordinary income?

Short-term capital gains are generally taxed as ordinary income. Most long-term capital gains receive preferential tax treatment, although special types of gains can have different maximum rates.

Can capital losses reduce capital gains?

Yes. Capital losses can generally be used to offset capital gains. If your losses exceed your gains, special rules limit how much net loss can generally be deducted against other income in a year, with unused losses potentially carried forward.

Do I have to pay capital gains tax when I sell a stock?

Not necessarily. Tax generally depends on whether you have a taxable gain, your basis, holding period, overall taxable income, and other factors. Selling an investment for a loss does not generally create a capital gain.

Does selling an investment after one year reduce the tax rate?

It can. Assets held for more than one year generally produce long-term capital gains, which may qualify for preferential federal rates.

What is the 3.8% NIIT?

The Net Investment Income Tax is an additional 3.8% federal tax that can apply to certain investment income when a taxpayer’s modified adjusted gross income exceeds the applicable statutory threshold.

Does this calculator include state capital gains tax?

No. The calculator estimates federal tax. State capital gains rules vary by state and can change independently of federal rules.

Is this Capital Gains Tax Calculator accurate for tax filing?

It is intended as an estimate, not as a substitute for preparing a tax return. Complex investments, special capital-gain rules, deductions, credits, loss carryovers, and other income can change the final tax amount.

Disclaimer: This calculator provides a general estimate of U.S. federal capital gains tax and is not tax or financial advice. Actual tax may vary based on your complete tax situation, deductions, losses, credits, asset type, and other IRS rules. State taxes are not included.

Related Tax Calculators

If you are planning your taxes, you may also find these NexCalco tools useful:

Scroll to Top