Capital Gains Rate Calculator

Capital Gains Tax Rate Calculator

Capital gains tax is a tax on the profit you make from selling an asset that has increased in value. Assets can include things like stocks, bonds, real estate, and collectibles. The tax rate you pay depends on how long you owned the asset (short-term vs. long-term) and your taxable income.

Short-term capital gains are profits from selling assets held for one year or less. These gains are typically taxed at your ordinary income tax rate.

Long-term capital gains are profits from selling assets held for more than one year. These gains are taxed at lower rates (0%, 15%, or 20% for most taxpayers) depending on your income bracket. This calculator will help you estimate your potential long-term capital gains tax rate based on your filing status and taxable income.

Single Married Filing Jointly Head of Household Married Filing Separately
function calculateCapitalGainsTax() { var costBasis = parseFloat(document.getElementById("assetCostBasis").value); var sellingPrice = parseFloat(document.getElementById("sellingPrice").value); var holdingPeriod = parseFloat(document.getElementById("assetHoldingPeriod").value); var taxableIncome = parseFloat(document.getElementById("taxableIncome").value); var filingStatus = document.getElementById("filingStatus").value; var resultDiv = document.getElementById("result"); resultDiv.innerHTML = ""; // Clear previous results if (isNaN(costBasis) || isNaN(sellingPrice) || isNaN(holdingPeriod) || isNaN(taxableIncome)) { resultDiv.innerHTML = "Please enter valid numbers for all fields."; return; } var capitalGain = sellingPrice – costBasis; var taxRate = "N/A"; var effectiveRate = "N/A"; var taxAmount = "N/A"; if (capitalGain < 0) { resultDiv.innerHTML = "You have a capital loss, not a gain. No capital gains tax applies."; return; } var shortTermThreshold = 1; // Years for short-term vs. long-term if (holdingPeriod marginalIncomeThresholds[3]) estimatedOrdinaryRate = 0.37; else if (taxableIncome > marginalIncomeThresholds[2]) estimatedOrdinaryRate = 0.35; else if (taxableIncome > marginalIncomeThresholds[1]) estimatedOrdinaryRate = 0.32; else if (taxableIncome > marginalIncomeThresholds[0]) estimatedOrdinaryRate = 0.24; else if (taxableIncome > 11000) estimatedOrdinaryRate = 0.12; // Specific for 10% vs 12% else estimatedOrdinaryRate = 0.10; } else if (filingStatus === "married_filing_jointly") { if (taxableIncome > marginalIncomeThresholds[3]) estimatedOrdinaryRate = 0.37; else if (taxableIncome > marginalIncomeThresholds[2]) estimatedOrdinaryRate = 0.35; else if (taxableIncome > marginalIncomeThresholds[1]) estimatedOrdinaryRate = 0.32; else if (taxableIncome > marginalIncomeThresholds[0]) estimatedOrdinaryRate = 0.24; else if (taxableIncome > 22000) estimatedOrdinaryRate = 0.12; // Specific for 10% vs 12% else estimatedOrdinaryRate = 0.10; } else if (filingStatus === "head_of_household") { if (taxableIncome > marginalIncomeThresholds[3]) estimatedOrdinaryRate = 0.37; else if (taxableIncome > marginalIncomeThresholds[2]) estimatedOrdinaryRate = 0.35; else if (taxableIncome > marginalIncomeThresholds[1]) estimatedOrdinaryRate = 0.32; else if (taxableIncome > marginalIncomeThresholds[0]) estimatedOrdinaryRate = 0.24; else if (taxableIncome > 15700) estimatedOrdinaryRate = 0.12; // Specific for 10% vs 12% else estimatedOrdinaryRate = 0.10; } taxRate = (estimatedOrdinaryRate * 100).toFixed(2) + "% (Ordinary Income Rate)"; taxAmount = (capitalGain * estimatedOrdinaryRate).toFixed(2); } else { // Long-term capital gains tax rates (2023/2024 approximate thresholds) var longTermThresholds = { 0: { rate: 0.00, maxIncomeSingle: 44625, maxIncomeMFJ: 89250, maxIncomeHoH: 59750 }, 15: { rate: 0.15, maxIncomeSingle: 49200, maxIncomeMFJ: 98400, maxIncomeHoH: 73800 }, // Income increases for MFJ 20: { rate: 0.20, maxIncomeSingle: Infinity, maxIncomeMFJ: Infinity, maxIncomeHoH: Infinity } }; var incomeThresholdsForLT; if (filingStatus === "single") { incomeThresholdsForLT = longTermThresholds[0]; if (taxableIncome > longTermThresholds[20].maxIncomeSingle) { taxRate = "20%"; effectiveRate = "20%"; } else if (taxableIncome > longTermThresholds[15].maxIncomeSingle) { taxRate = "15%"; effectiveRate = "15%"; } else { taxRate = "0%"; effectiveRate = "0%"; } } else if (filingStatus === "married_filing_jointly") { incomeThresholdsForLT = longTermThresholds[0]; if (taxableIncome > longTermThresholds[20].maxIncomeMFJ) { taxRate = "20%"; effectiveRate = "20%"; } else if (taxableIncome > longTermThresholds[15].maxIncomeMFJ) { taxRate = "15%"; effectiveRate = "15%"; } else { taxRate = "0%"; effectiveRate = "0%"; } } else if (filingStatus === "head_of_household") { incomeThresholdsForLT = longTermThresholds[0]; if (taxableIncome > longTermThresholds[20].maxIncomeHoH) { taxRate = "20%"; effectiveRate = "20%"; } else if (taxableIncome > longTermThresholds[15].maxIncomeHoH) { taxRate = "15%"; effectiveRate = "15%"; } else { taxRate = "0%"; effectiveRate = "0%"; } } else if (filingStatus === "married_filing_separately") { // For simplicity, we'll use single thresholds, though they are often lower. // A more precise calculator would use MFS-specific thresholds. if (taxableIncome > longTermThresholds[20].maxIncomeSingle) { taxRate = "20%"; effectiveRate = "20%"; } else if (taxableIncome > longTermThresholds[15].maxIncomeSingle) { taxRate = "15%"; effectiveRate = "15%"; } else { taxRate = "0%"; effectiveRate = "0%"; } } var effectiveRateValue = parseFloat(taxRate.replace('%', ")) / 100; taxAmount = (capitalGain * effectiveRateValue).toFixed(2); } resultDiv.innerHTML = "Capital Gain: $" + capitalGain.toFixed(2) + "" + "Estimated Capital Gains Tax Rate: " + taxRate + "" + "Estimated Tax Amount: $" + taxAmount; }

Leave a Comment