Skip to content

Capital Gains Tax Calculator

Calculate capital gains tax on stocks, real estate, and other investments. Compare short-term vs. long-term rates, estimate your tax liability, and plan tax-efficient selling strategies.

Capital Gains Tax Calculator: Example Calculation

Using Purchase Price: $10,000, Sale Price: $15,000, Holding Period: Long-Term (1yr+), Filing Status: Single:

The estimated Capital Gain is $5,000.

Result Value
Capital Gain $5,000
Tax Rate 15.0%
Estimated Tax Owed $750
Net Profit $4,250

Adjust the values in the calculator above for your own scenario.

Loading calculator

Preparing Capital Gains Tax Calculator...

Reviewed & Methodology

Every calculator is built using industry-standard formulas, validated against authoritative sources, and reviewed for accuracy against our published methodology. All calculations run privately in your browser - no data is stored or shared.

Educational tool only -- not financial, tax, or legal advice. Consult a licensed professional for decisions about your situation.

Last reviewed:

Reviewed by:

Written by:

How to Use the Capital Gains Tax Calculator

  1. 1. Enter your purchase price (cost basis) - input the original price you paid for the asset, including any commissions or fees.
  2. 2. Enter your sale price - input the amount you received (or expect to receive) when selling the asset.
  3. 3. Select the holding period - choose short-term (held 1 year or less) or long-term (held more than 1 year) to apply the correct tax rate.
  4. 4. Enter your taxable income - this determines which capital gains tax bracket applies to your gain.
  5. 5. Review your estimated tax - see the capital gain amount, applicable tax rate, estimated tax owed, and net proceeds after tax.

Capital Gains Tax Calculator

When you sell a stock, piece of real estate, or other investment for more than you paid, the profit is a capital gain -- and the IRS taxes it. This calculator estimates your federal capital gains tax by taking your purchase price (cost basis), sale price, holding period, and taxable income. It shows your gain, applicable tax rate, estimated tax owed, and net proceeds after federal tax. Capital gains treatment varies dramatically based on how long you held the asset, so knowing the rate before you sell can change your timing decision.

How Capital Gains Tax Is Calculated

The starting point is always the same: Capital Gain = Sale Price - Cost Basis. What happens next depends on your holding period:

  • Short-term gain (held 1 year or less): taxed as ordinary income at your marginal rate (10%, 12%, 22%, 24%, 32%, 35%, or 37%)
  • Long-term gain (held more than 1 year): taxed at preferential rates of 0%, 15%, or 20% based on taxable income
  • Net Investment Income Tax (NIIT): an additional 3.8% applies to investment income when modified AGI exceeds $200,000 single / $250,000 married filing jointly
  • Depreciation recapture: for rental or business property, depreciation previously deducted is recaptured at a 25% rate, separate from the long-term gain rate

For 2026, the long-term capital gains brackets for single filers are approximately: 0% on income up to $48,350; 15% on income up to $533,400; 20% above that.

Worked Examples

Scenario 1 -- Stock held less than a year: An investor bought 100 shares of a tech stock at $85/share ($8,500 total) and sold them 8 months later at $130/share ($13,000 total). Gain = $4,500. Short-term gain taxed at the investor's 22% ordinary income rate. Federal tax = $990. Net proceeds after federal tax = $12,010. If they had waited four more months past the one-year mark, the same $4,500 gain at a 15% long-term rate would cost only $675 -- saving $315.

Scenario 2 -- Primary home sale: A couple bought a home for $310,000 in 2019 and sold it for $550,000 in 2026. Gross gain = $240,000. The married filing jointly exclusion is $500,000 under Section 121. Since they lived there as their primary residence for more than 2 of the last 5 years, the full $240,000 gain is excluded. Federal tax = $0.

Scenario 3 -- Rental property sale: An investor bought a rental property for $200,000 in 2015, claimed $40,000 in depreciation over 10 years, and sold it for $380,000 in 2026. Adjusted cost basis = $200,000 - $40,000 = $160,000. Total gain = $220,000. Depreciation recapture on $40,000 at 25% = $10,000. Remaining long-term gain of $180,000 at 15% = $27,000. NIIT of 3.8% on $220,000 = $8,360. Total federal tax = $45,360.

Reference Table

Scenario Cost Basis Sale Price Gain Holding Rate Est. Federal Tax
Stock -- short-term, 22% bracket $8,500 $13,000 $4,500 8 months 22% $990
Stock -- short-term, 32% bracket $20,000 $35,000 $15,000 11 months 32% $4,800
Stock -- long-term, 0% bracket $5,000 $12,000 $7,000 3 years 0% $0
Stock -- long-term, 15% bracket $10,000 $15,000 $5,000 2 years 15% $750
Stock -- long-term, 20% bracket $50,000 $120,000 $70,000 5 years 20% $14,000
Home sale -- exclusion applies $310,000 $550,000 $240,000 7 years 0% $0
Home sale -- partial exclusion $200,000 $700,000 $500,000 8 years 15% $37,500
Rental property (+ recapture) $160,000 $380,000 $220,000 10 years 15%+25% $45,360
Crypto -- short-term, 24% $15,000 $28,000 $13,000 7 months 24% $3,120
Crypto -- long-term, 15% $15,000 $28,000 $13,000 18 months 15% $1,950

When to Use

  • Before selling a stock or investment property, to compare the tax cost of selling now versus waiting past the one-year mark for long-term treatment
  • Planning a year-end tax-loss harvest -- quantify how much gain you need to offset before selling losing positions
  • Evaluating whether to use the primary residence exclusion on a home you have lived in, or whether it makes sense to delay a sale to qualify
  • Estimating net proceeds from an investment sale so you know exactly how much you will have left after the IRS takes its share
  • Deciding between FIFO, specific identification, or average cost basis methods for stock sales to minimize the gain recognized

Common Mistakes

  1. Forgetting the holding period down to the exact day. Long-term treatment requires holding more than 365 days -- not "about a year." Selling at 364 days means paying ordinary income rates. For large gains, double-check the exact purchase date before scheduling a sale.
  2. Using the original purchase price as cost basis for inherited assets. Inherited assets typically receive a "stepped-up" basis equal to the fair market value on the date of death. Using the decedent's original purchase price instead massively overstates your taxable gain.
  3. Ignoring state capital gains tax. This calculator covers federal tax only. California taxes capital gains as ordinary income at up to 13.3%. New York adds up to 10.9% state plus city tax. Your actual after-tax proceeds can be 10-15 percentage points lower than the federal calculation alone.
  4. Overlooking depreciation recapture on rental property. Many landlords are surprised to learn that depreciation they deducted over the years is recaptured at 25% when the property is sold -- separate from the standard long-term capital gains rate on the remaining appreciation. Always calculate these two components separately.

Current Context for 2026

Long-term capital gains rates are unchanged from prior years. The 0% bracket threshold has increased modestly with inflation adjustments -- single filers with taxable income below approximately $48,350 owe zero federal tax on long-term gains, making this bracket worth targeting for lower-income years. The primary residence exclusion ($250,000 single / $500,000 married) has not been adjusted for inflation since it was set in 1997, meaning it covers a smaller share of appreciation in high-cost markets like San Francisco, New York, and Boston where prices have risen sharply. Cryptocurrency is treated as property by the IRS -- each sale or swap is a taxable event, and short-term crypto gains are taxed as ordinary income, which catches many investors off guard. Estate tax exemption is $13.99 million per person in 2026, meaning stepped-up basis on inherited assets remains widely available.

Tips

  1. Hold investments for at least one year and one day from the purchase date -- at a 22% income bracket, shifting a $20,000 gain from short-term to long-term saves $1,400 in federal tax
  2. In years when your income is unusually low (career break, major deductions, retirement transition), review your long-term gain exposure against the 0% bracket ceiling and consider realizing gains that year
  3. Use tax-loss harvesting to offset gains dollar-for-dollar, but observe the 30-day wash-sale rule -- repurchasing a substantially identical security within 30 days before or after the sale disallows the loss
  4. For donated appreciated assets held more than one year, you avoid capital gains entirely and deduct the full fair market value, making donation often more tax-efficient than selling and donating cash
  5. On rental property sales, get a depreciation schedule from your accountant before listing -- knowing the recapture amount upfront prevents surprises in net proceeds
  6. For stocks with lots purchased at different prices, use the specific identification method to sell the highest-cost shares first, minimizing the taxable gain recognized in the current year
  • Tax Calculator -- estimate your full federal income tax including how capital gains stack on top of ordinary income
  • Self-Employment Tax Calculator -- if you also have business or freelance income, see how SE tax interacts with investment gains
  • Profit Margin Calculator -- for business asset sales, understand the margin on the original investment relative to the tax cost of exiting

Frequently Asked Questions

What is the difference between short-term and long-term capital gains tax rates?
Short-term capital gains apply to assets held for one year or less and are taxed as ordinary income at your regular federal tax rate, which can be as high as 37%. Long-term capital gains apply to assets held for more than one year and are taxed at preferential rates of 0%, 15%, or 20% depending on your taxable income. For 2024, single filers pay 0% on long-term gains if taxable income is below $47,025, 15% up to $518,900, and 20% above that. This difference means holding an investment for just one extra day past the one-year mark can save you thousands in taxes.
How do I calculate my cost basis for stocks or real estate?
Cost basis is the original purchase price plus any additional costs like broker commissions, transfer fees, or improvements (for real estate). For stocks, if you reinvested dividends, each reinvestment adds to your basis. For inherited assets, the basis is typically 'stepped up' to the fair market value on the date of the decedent's death. For real estate, add the cost of permanent improvements (new roof, kitchen remodel) but not routine maintenance. Accurate cost basis is critical because it directly reduces your taxable gain.
What is tax-loss harvesting and how can it reduce my capital gains tax?
Tax-loss harvesting is the strategy of selling investments at a loss to offset capital gains from other investments. You can use capital losses to offset gains dollar-for-dollar, and if your losses exceed your gains, you can deduct up to $3,000 of net losses against ordinary income per year, carrying any remaining losses forward to future years. Be aware of the wash-sale rule: if you buy a substantially identical security within 30 days before or after selling at a loss, the IRS disallows the loss deduction.
Are there any exemptions from capital gains tax?
The most significant exemption is the primary residence exclusion under Section 121. If you have owned and lived in your home for at least 2 of the last 5 years, you can exclude up to $250,000 of gain ($500,000 for married couples filing jointly) from capital gains tax. Assets held in tax-advantaged accounts like 401(k)s and IRAs are not subject to capital gains tax when sold inside the account, though distributions are taxed differently. Gifts to charity of appreciated assets can also avoid capital gains entirely while providing a charitable deduction.
How do I report capital gains on my tax return?
Capital gains and losses are reported on Schedule D of Form 1040, with individual transaction details listed on Form 8949. Your brokerage will send you Form 1099-B showing proceeds from each sale. You must match each sale with its cost basis and holding period. Net short-term and long-term gains are calculated separately, then combined on Schedule D. If you have gains from real estate, you may also need Form 4797 for business property or the primary residence exclusion worksheet. Keep all purchase records for at least 3 years after filing.
Embed this calculator

Add this free calculator to your website. Copy the code below and keep the attribution link - it's what keeps these tools free:

Cite this calculator

Copy this citation for papers, articles, or coursework:

Alex Crabinsky. "Capital Gains Tax Calculator." Numeraty, February 24, 2026, https://numeraty.com/capital-gains-tax-calculator/

Related Tax & Business Calculators

Tax & Business

Bond Calculator

Calculate bond price, current yield, and yield to maturity. Enter face value, coupon rate, maturity, and market interest rate to see if a bond trades at a premium or discount and evaluate its income potential.

Tax & Business

Break Even Calculator

Calculate your break-even point in units and revenue. Enter fixed costs, variable cost per unit, and selling price to find how many sales you need to cover all costs and start generating profit.

Tax & Business

Budget Calculator

Plan your monthly budget using the 50/30/20 rule. Enter your take-home pay and expenses to see how your spending compares to recommended targets for needs, wants, and savings.

Tax & Business

Business Loan Calculator

Calculate monthly payments, total interest, and amortization for business loans. Compare SBA loans, term loans, and lines of credit to find the best financing for your business.

Tax & Business

Cash Flow Calculator

Analyze your business cash flow by tracking inflows and outflows. Calculate net cash flow, operating cash flow, and free cash flow to understand your company's financial health.

Tax & Business

Commission Calculator

Calculate sales commission, total annual compensation, and monthly income based on your sales volume, commission rate, and base salary. Model different comp structures and compare job offers.

Tax & Business

Currency Conversion Calculator

Convert between 12 major world currencies including USD, EUR, GBP, JPY, and more. Estimate exchange amounts for travel budgets, international business pricing, and cross-border transactions.

Tax & Business

Depreciation Calculator

Calculate asset depreciation using straight-line or double declining balance methods. Enter cost, salvage value, and useful life to see annual expense, monthly amounts, and full depreciation schedules.

Tax & Business

Discount Calculator

Calculate sale prices, percentage discounts, and savings amounts instantly. Find the original price from a sale price, stack multiple discounts, and compare deals to find the best value.

Tax & Business

Emergency Fund Calculator

Calculate your ideal emergency fund target based on monthly expenses and coverage months. Track your progress, see the savings gap, and estimate months to reach your goal.

Tax & Business

Estate Tax Calculator

Estimate your federal estate tax liability based on gross estate value, deductions, and exemptions. See how much your heirs may owe and calculate the net amount passed to beneficiaries.

Tax & Business

Freelance Rate Calculator

Determine your ideal freelance hourly or project rate by accounting for taxes, benefits, expenses, and non-billable time. Calculate the rate you need to match or exceed employee compensation.

Calculators