Capital Gains Tax Calculator

Estimate federal capital gains tax on investments based on holding period and income.




Short term vs long term capital gains tax rates compared with visual chart
Short term vs long term capital gains tax rates compared with visual chart

How to Use the Capital Gains Tax Calculator

Selling an investment for more than you paid triggers capital gains tax, but the amount you owe depends on several moving parts. This calculator walks you through them so there are no surprises at tax time. Begin with your purchase price, which is your cost basis, and your sale price. The difference between the two is your capital gain or loss.

  1. Enter your purchase price. This is what you originally paid, including any commissions or fees that were part of buying. A higher cost basis means a smaller taxable gain.
  2. Enter your sale price. This is what you received, minus selling costs like brokerage commissions. The calculator subtracts your basis to find the gain.
  3. Select your holding period. Assets held one year or less get short-term treatment and are taxed like ordinary income. Assets held more than one year qualify for the lower long-term rates of 0, 15, or 20 percent.
  4. Choose your filing status. The income thresholds for the 0, 15, and 20 percent long-term brackets differ for single, joint, and head-of-household filers.
  5. Enter your other taxable income. Your existing income determines which bracket your gain falls into, because the gain stacks on top of your other earnings.
  6. Add your state rate if you want the full picture. Most states tax capital gains as ordinary income. Enter your marginal state rate to include it.
  7. Click Calculate. You will see federal tax, state tax, your effective rate, and how much you keep after tax.

How Capital Gains Tax Works

The United States taxes investment profits differently depending on how long you held the asset. Short-term gains, from assets held one year or less, are taxed at your ordinary income rates, the same rates that apply to your salary. For most investors that means 22 or 24 percent, though it can reach 37 percent at the top. Long-term gains get preferential treatment: 0 percent, 15 percent, or 20 percent depending on your taxable income.

For 2026, a single filer pays 0 percent on long-term gains until taxable income reaches about 48,350 dollars, then 15 percent up to roughly 533,400 dollars, and 20 percent above that. Married couples filing jointly get roughly double those thresholds. These thresholds include the gain itself stacked on top of your other income, which is why the calculator asks for your existing taxable income.

High earners face one more layer: the 3.8 percent net investment income tax. It applies to the portion of investment income that pushes your modified adjusted gross income above 200,000 dollars single or 250,000 dollars joint. The calculator includes it automatically when your income crosses those lines.

Losses have their own rules. If you sell at a loss, you can use it to offset gains dollar for dollar, and deduct up to 3,000 dollars per year against ordinary income. Unused losses carry forward indefinitely, so a bad year can shelter gains for years to come.

Worked Example

Take Daniel, a single filer earning 75,000 dollars in taxable income. He bought stock for 10,000 dollars and sold it 18 months later for 18,000 dollars, a long-term gain of 8,000 dollars. His total income including the gain is 83,000 dollars.

Because his income sits well within the 15 percent long-term bracket, which for single filers runs up to about 533,400 dollars, the entire 8,000 dollar gain is taxed at 15 percent. His federal tax on the gain is 1,200 dollars, leaving him 16,800 dollars after tax from the sale.

Now imagine Daniel had sold after only 8 months. The gain would be short-term and taxed as ordinary income. Stacked on top of his 75,000 dollar salary, the 8,000 dollars falls in the 22 percent bracket, costing him 1,760 dollars in federal tax. Simply by waiting four more months past the one-year mark, he saved 560 dollars. That is the power of the holding period, and exactly what this calculator helps you evaluate before you sell.

2026 Long-Term Capital Gains Thresholds

Long-term gains stack on top of your ordinary income and are taxed in three tiers. For 2026, the 0 percent tier covers taxable income up to 49,450 dollars single (98,900 dollars married filing jointly); the 15 percent tier fills the middle; and the 20 percent tier starts above 545,500 dollars single (613,700 dollars jointly).

“Stacking” means your gains sit on top of wages and other income, so a raise can push existing gains into a higher bracket. Add the 3.8 percent net investment income tax above 200,000 dollars single (250,000 dollars joint) of modified adjusted gross income, and high earners can face 23.8 percent on long-term gains.

Two special rates: 25 percent on unrecaptured Section 1250 gains (depreciation recapture on real estate) and 28 percent on collectibles. And do not forget the states — most tax capital gains as ordinary income, so your real rate is the federal rate plus your state’s.

Related Calculators

Investing for the long term? Compare retirement account tax treatment with our Roth IRA Calculator, or estimate crypto-specific gains with our Crypto Profit Calculator.

Capital gains tax brackets by income level illustrated
Capital gains tax brackets by income level illustrated

Frequently Asked Questions

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

Short-term gains come from assets held one year or less and are taxed as ordinary income. Long-term gains come from assets held more than one year and get preferential rates of 0, 15, or 20 percent depending on your income.

How can I reduce my capital gains tax?

Hold assets longer than a year, harvest losses to offset gains, donate appreciated stock to charity, use tax-advantaged accounts like IRAs and 401(k)s, and consider timing sales in lower-income years.

Do I pay capital gains tax if I reinvest the money?

Yes, in a taxable account. Selling triggers the tax whether or not you reinvest the proceeds. Only exchanges inside retirement accounts avoid immediate taxation.

What is the net investment income tax?

A 3.8 percent surtax on investment income for single filers above $200,000 and joint filers above $250,000 of modified adjusted gross income. It applies to capital gains, dividends, and rental income.

Can capital losses offset my salary?

Up to $3,000 per year of net capital losses can offset ordinary income ($1,500 if married filing separately). Remaining losses carry forward to future years indefinitely.

How does the home sale exclusion work?

Section 121 lets single filers exclude up to 250,000 dollars of gain (500,000 dollars joint) on a primary residence you owned and lived in for at least 2 of the last 5 years. You can generally use it once every 2 years.

Do states tax capital gains too?

Most do, usually as ordinary income at your state’s rate. A few states have no income tax at all. When estimating a sale, always add your state rate on top of the federal number.

Scroll to Top