Free Capital Gains Tax Calculator (2026)

Short and long term asset capital gains tax. Calculate instantly — no signup required. Updated for 2026.

Capital Gains Tax Calculator

$
%

What Is a Capital Gains Tax Calculator?

A capital gains tax calculator is a specialized investment-tax tool designed to estimate the tax liability incurred when you sell an asset — such as stocks, bonds, mutual funds, cryptocurrencies, or real estate — for a profit. When you sell an investment for more than its purchase price (its "cost basis"), the profit is classified as a capital gain and is subject to taxation by the federal government.

The U.S. tax code categorizes capital gains based on the holding period. **Short-term capital gains** apply to assets held for one year or less, which are taxed at your ordinary progressive income tax bracket. **Long-term capital gains** apply to assets held for more than one year, which enjoy highly favorable tax rates (0%, 15%, or 20% depending on your income). Our capital gains tax calculator helps you model these scenarios to optimize your trade timing and minimize tax drag.

How to Use This Capital Gains Tax Calculator

To calculate your capital gains tax liability, enter the following parameters:

  1. Asset Purchase Price (Cost Basis): The original cost to buy the asset, including commissions and fees.
  2. Asset Selling Price: The gross amount you received upon selling the asset.
  3. Holding Period: The length of time you owned the asset (1 year or less vs. more than 1 year).
  4. Annual Taxable Income: Your regular taxable income, which determines your long-term capital gains tax bracket.
  5. Filing Status: Your filing status (Single, Married, etc.), which sets the tax thresholds.

The calculator immediately outputs your net profit, capital gains tax bracket, total tax liability, and your net take-home gains.

The Capital Gains Tax Formula

First, the net capital gain (G) is calculated:

G = Selling Price − Cost Basis

If the holding period is short-term, the tax rate (R) is identical to your ordinary marginal tax rate. If long-term, the rate is determined by IRS thresholds:

  • 0% rate for lower income brackets
  • 15% rate for middle income brackets
  • 20% rate for high income brackets

The final tax liability is computed as: Tax = G × R

Step-by-Step Practical Example

Let’s calculate the tax difference for a stock sale profit of $15,000 for a single filer earning a taxable income of $65,000:

  • Net Capital Gain (G): $15,000
  • Taxable Income: $65,000
  • Filing Status: Single

Scenario A: Short-Term Gain (held for 9 months)
Your ordinary income bracket is 22%.
Tax_short = $15,000 × 22% = $3,300 tax liability.

Scenario B: Long-Term Gain (held for 14 months)
For a single filer with a $65,000 income, the long-term capital gains tax rate is 15%.
Tax_long = $15,000 × 15% = $2,250 tax liability.

Step 3: Compare and analyze the savings
By simply holding the stock for an extra 5 months to cross the one-year threshold, you save $1,050 in taxes, boosting your net return significantly.

Capital Gains Tax Reduction Tips

  • Hold Assets for More Than One Year: Whenever possible, avoid selling profitable investments before the 365-day mark to secure the highly favorable long-term tax rates.
  • Practice Tax-Loss Harvesting: You can offset your taxable capital gains by selling underperforming assets at a loss. If your capital losses exceed your gains, you can deduct up to $3,000 of the net loss against your ordinary income.

Frequently Asked Questions

What is the holding period requirement for long-term capital gains?

To qualify for favorable long-term capital gains tax rates, you must hold the asset for more than one year (at least 366 days) before selling. If you sell the asset on or before the 365-day anniversary of your purchase, the profits are treated as short-term capital gains and taxed at your regular ordinary income tax bracket.

How does the IRS determine the cost basis of a stock sale?

Your cost basis is the total purchase price of the asset, including any transaction fees, brokerage commissions, or mutual fund loads. When calculating capital gains, you subtract this cost basis from your gross sales price. If you purchased shares at different times, you can use methods like FIFO (First-In, First-Out) or Specific Identification to determine the cost basis.

Can capital losses offset capital gains?

Yes. You can use capital losses to offset capital gains dollar-for-dollar. For example, if you have a $10,000 capital gain and a $4,000 capital loss in the same tax year, your taxable capital gain is reduced to $6,000. If your losses exceed your gains, you can use up to $3,000 of the remaining loss to offset ordinary income, rolling over any excess loss to future years.

What is the Net Investment Income Tax (NIIT)?

The NIIT is an additional 3.8% federal tax that applies to individuals with high net investment income (including capital gains, dividends, interest, and rental income) whose Modified Adjusted Gross Income (MAGI) exceeds specific thresholds ($200,000 for single filers and $250,000 for married couples filing jointly).

How are capital gains taxed on the sale of a primary home?

Under IRS Section 121, if you sell your primary residence, you can exclude up to $250,000 of capital gains (up to $500,000 for married couples) from tax. To qualify for this exclusion, you must meet the "ownership and use tests," meaning you must have owned and lived in the home as your primary residence for at least two out of the five years prior to the sale.