Capital Gains Tax Calculator

Capital Gains Tax Calculator
Long-term (Held > 1 Year)Short-term (Held ≤ 1 Year)
Estimated Tax Due: $0.00
function calculateTax(){var pPrice=parseFloat(document.getElementById('purchase_price').value)||0;var pCosts=parseFloat(document.getElementById('purchase_costs').value)||0;var sPrice=parseFloat(document.getElementById('sale_price').value)||0;var sCosts=parseFloat(document.getElementById('sale_costs').value)||0;var rate=parseFloat(document.getElementById('tax_rate').value)||0;var period=document.getElementById('holding_period').value;var totalBasis=pPrice+pCosts;var netProceeds=sPrice-sCosts;var gain=netProceeds-totalBasis;var taxDue=0;if(gain>0){taxDue=gain*(rate/100);}var breakdown="";if(document.getElementById('show_breakdown').checked){breakdown="
"+"Cost Basis: $"+totalBasis.toLocaleString(undefined,{minimumFractionDigits:2})+"
"+"Net Sale Proceeds: $"+netProceeds.toLocaleString(undefined,{minimumFractionDigits:2})+"
"+"Total Capital Gain: $"+gain.toLocaleString(undefined,{minimumFractionDigits:2})+"
"+"Tax Rate Applied: "+rate+"% ("+period+" period)";}document.getElementById('resultSummary').innerHTML="Estimated Tax Due: $"+taxDue.toLocaleString(undefined,{minimumFractionDigits:2});document.getElementById('breakdownContent').innerHTML=breakdown;}

Calculator Use

The capital gains tax calculator is a professional tool designed to help investors estimate the taxes owed on the sale of assets like stocks, bonds, or real estate. By accounting for purchase costs and selling expenses, this calculator provides a clear picture of your actual net profit and the resulting tax liability.

This tool is essential for financial planning, allowing you to determine how much of your profit you will actually keep after Uncle Sam takes his share. It distinguishes between long-term and short-term holdings, which is critical because tax rates vary significantly based on how long you owned the asset.

Purchase Price & Costs
The original price paid for the asset plus any associated costs such as commissions, legal fees, or closing costs. These combined form your "Adjusted Cost Basis."
Selling Price & Costs
The final amount received from the sale, minus any expenses incurred to execute the sale (like broker fees or advertising).
Tax Rate
The percentage rate applied to your capital gain. For most long-term investments, this is 0%, 15%, or 20% depending on your total annual income.

How It Works

Calculating your tax starts with finding the realized gain. The formula used by our capital gains tax calculator follows the standard IRS methodology for determining taxable profit:

Tax Liability = ((Selling Price – Selling Costs) – (Purchase Price + Purchase Costs)) × Tax Rate

  • Step 1: Determine Net Proceeds: Subtract your selling costs from the gross sale price.
  • Step 2: Determine Cost Basis: Add your purchase costs to the original price of the asset.
  • Step 3: Calculate Gain: Subtract the Cost Basis from the Net Proceeds.
  • Step 4: Apply Rate: Multiply the gain by your applicable tax rate based on your income and holding period.

Calculation Example

Example: Suppose you bought shares of a tech company for $10,000 and paid $50 in brokerage fees. Two years later, you sold them for $15,000 and paid $75 in selling fees. You are in the 15% long-term capital gains bracket.

Step-by-step solution:

  1. Adjusted Basis = $10,000 + $50 = $10,050
  2. Net Sale Proceeds = $15,000 – $75 = $14,925
  3. Total Capital Gain = $14,925 – $10,050 = $4,875
  4. Calculate Tax: $4,875 × 0.15
  5. Total Tax Due = $731.25

Common Questions

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

Short-term gains apply to assets held for one year or less. These are taxed as ordinary income at your standard marginal tax rate. Long-term gains apply to assets held for more than a year and generally benefit from lower, preferential tax rates (0%, 15%, or 20%).

Can capital losses offset capital gains?

Yes. If you sell an asset for less than your basis, you realize a capital loss. These losses can be used to "cancel out" capital gains in the same tax year. If your total losses exceed your total gains, you can generally use up to $3,000 of the remaining loss to offset ordinary income.

Does this calculator work for real estate?

Yes, the general math is the same. However, for a primary residence, you may qualify for a Section 121 exclusion, which allows individuals to exclude up to $250,000 (or $500,000 for married couples) of gain from their income if certain residency requirements are met.

Leave a Comment