How Do You Calculate Capital Gains

.cg-calc-container { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; max-width: 800px; margin: 20px auto; padding: 25px; border: 1px solid #e1e1e1; border-radius: 8px; background-color: #f9f9f9; color: #333; } .cg-calc-header { text-align: center; margin-bottom: 25px; } .cg-calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; } .cg-calc-group { margin-bottom: 15px; } .cg-calc-label { display: block; font-weight: 600; margin-bottom: 8px; font-size: 14px; } .cg-calc-input { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; font-size: 16px; } .cg-calc-btn { grid-column: span 2; background-color: #0056b3; color: white; padding: 15px; border: none; border-radius: 4px; cursor: pointer; font-size: 18px; font-weight: bold; transition: background-color 0.2s; } .cg-calc-btn:hover { background-color: #004494; } .cg-calc-results { margin-top: 25px; padding: 20px; background-color: #fff; border-radius: 4px; border: 1px solid #ddd; display: none; } .cg-result-item { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #eee; } .cg-result-item:last-child { border-bottom: none; } .cg-result-label { font-weight: 600; } .cg-result-value { color: #28a745; font-weight: bold; } .cg-loss { color: #dc3545 !important; } @media (max-width: 600px) { .cg-calc-grid { grid-template-columns: 1fr; } .cg-calc-btn { grid-column: span 1; } }

Capital Gains Tax Calculator

Calculate your net profit and estimated tax liability on asset sales.

Adjusted Cost Basis:
Net Selling Proceeds:
Total Capital Gain/Loss:
Estimated Tax Owed:
Net Profit After Tax:
function calculateCapitalGains() { var buyPrice = parseFloat(document.getElementById('buyPrice').value) || 0; var sellPrice = parseFloat(document.getElementById('sellPrice').value) || 0; var buyCosts = parseFloat(document.getElementById('buyCosts').value) || 0; var sellCosts = parseFloat(document.getElementById('sellCosts').value) || 0; var improvements = parseFloat(document.getElementById('improvements').value) || 0; var taxRate = parseFloat(document.getElementById('taxRate').value) || 0; // Adjusted Cost Basis = Purchase Price + Purchase Costs + Improvements var adjustedBasis = buyPrice + buyCosts + improvements; // Net Proceeds = Selling Price – Selling Costs var netProceeds = sellPrice – sellCosts; // Capital Gain = Net Proceeds – Adjusted Basis var capitalGain = netProceeds – adjustedBasis; // Tax Owed (only if gain is positive) var taxOwed = 0; if (capitalGain > 0) { taxOwed = capitalGain * (taxRate / 100); } var netProfit = capitalGain – taxOwed; // Display Results document.getElementById('cgResults').style.display = 'block'; document.getElementById('resAdjustedBasis').innerText = adjustedBasis.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2}); document.getElementById('resNetProceeds').innerText = netProceeds.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2}); var gainElement = document.getElementById('resCapitalGain'); gainElement.innerText = capitalGain.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2}); if (capitalGain < 0) { gainElement.className = 'cg-result-value cg-loss'; } else { gainElement.className = 'cg-result-value'; } document.getElementById('resTaxOwed').innerText = taxOwed.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2}); var profitElement = document.getElementById('resNetProfit'); profitElement.innerText = netProfit.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2}); if (netProfit < 0) { profitElement.className = 'cg-result-value cg-loss'; } else { profitElement.className = 'cg-result-value'; } }

How to Calculate Capital Gains: A Step-by-Step Guide

Calculating capital gains is a critical skill for investors in real estate, stocks, or any other appreciable asset. At its simplest level, a capital gain is the profit you realize when you sell an asset for more than its "basis." However, to avoid overpaying taxes, you must understand the concept of the Adjusted Cost Basis.

Step 1: Determine the Purchase Price and Purchase Costs

Your starting point is the original price you paid for the asset. To this, you should add any costs incurred during the acquisition. For real estate, this includes legal fees, title insurance, and transfer taxes. This combined figure is your initial cost basis.

Step 2: Add Capital Improvements

One of the most common mistakes is forgetting to include improvements. A capital improvement is a permanent structural change or restoration that adds value to the property, prolongs its useful life, or adapts it to new uses.

  • Included: Adding a new roof, finishing a basement, or installing a HVAC system.
  • Excluded: General repairs and maintenance, such as fixing a leaky faucet or painting a room.
Adding these to your initial basis gives you your Adjusted Cost Basis.

Step 3: Calculate Net Selling Proceeds

When you sell the asset, you don't keep the entire check. You must subtract the costs of the sale. This usually includes agent commissions, advertising fees, and closing costs. The amount left over is your Net Selling Proceeds.

Step 4: The Final Calculation

The formula for capital gains is:

Capital Gain = Net Selling Proceeds – Adjusted Cost Basis

Real-World Example

Imagine you bought a rental property for 250,000. You paid 5,000 in closing costs. Over five years, you spent 30,000 on a kitchen remodel. Your Adjusted Cost Basis is now 285,000.

You sell the property for 400,000 but pay a 6% commission (24,000). Your Net Proceeds are 376,000.

Your Capital Gain is 376,000 – 285,000 = 91,000. If you are in a 15% long-term capital gains tax bracket, you would owe 13,650 in taxes.

Short-Term vs. Long-Term Gains

The length of time you hold the asset is crucial for tax purposes:

  • Short-Term: Assets held for one year or less are taxed at ordinary income tax rates (usually higher).
  • Long-Term: Assets held for more than one year benefit from preferential tax rates (typically 0%, 15%, or 20% depending on your total income).

Leave a Comment