This is an estimate. Consult a tax professional for personalized advice.
Tax rates are subject to change.
Understanding Capital Gains Tax in California
Capital gains tax is levied on the profit you make from selling an asset that has increased in value. This applies to various assets like stocks, bonds, real estate, and collectibles. In California, you are subject to both federal and state capital gains taxes. The tax rate depends on how long you held the asset (short-term vs. long-term) and your overall income.
How Capital Gains are Calculated
The basic formula for calculating capital gain is:
Capital Gain = Selling Price – (Purchase Price + Cost of Improvements + Selling Costs)
This calculator uses this formula to determine your taxable capital gain.
Short-Term vs. Long-Term Capital Gains
Short-Term Capital Gains: If you hold an asset for one year or less, any profit is considered a short-term capital gain. These gains are taxed at your ordinary income tax rate, which can be significantly higher.
Long-Term Capital Gains: If you hold an asset for more than one year, any profit is considered a long-term capital gain. These are generally taxed at lower, preferential rates.
California Capital Gains Tax Rates (2023/2024 – Subject to Change)
California does NOT have separate tax rates for long-term capital gains. Instead, long-term capital gains are treated as ordinary income and taxed at the state's progressive income tax rates. The rates range from 1% to 13.3% (as of recent tax years). Your specific rate depends on your total taxable income.
This calculator estimates your California capital gains tax based on your provided annual income, which helps determine your marginal tax bracket.
Federal Capital Gains Tax Rates (2023/2024 – Subject to Change)
The federal government also taxes capital gains. The rates for long-term capital gains are typically 0%, 15%, or 20%, depending on your taxable income. Short-term capital gains are taxed at your ordinary federal income tax rates (ranging from 10% to 37%).
Key Factors Affecting Your Tax Liability
Holding Period: Crucial for determining if gains are short-term or long-term.
Purchase Price & Selling Price: The core components of calculating the gain.
Improvements & Selling Costs: These reduce your taxable gain.
Annual Income: Determines your marginal tax bracket for both federal and state taxes.
Depreciation Recapture (for Real Estate): If you depreciated a property, a portion of the gain might be taxed at a higher rate (up to 25% federally). This calculator does not account for depreciation recapture.
Disclaimer
This calculator provides an estimate for informational purposes only. Tax laws are complex and subject to change. It's essential to consult with a qualified tax professional or CPA for advice tailored to your specific financial situation. This tool does not account for all potential deductions, credits, or specific tax situations like depreciation recapture.
function calculateCapitalGains() {
var purchasePrice = parseFloat(document.getElementById("purchasePrice").value);
var sellingPrice = parseFloat(document.getElementById("sellingPrice").value);
var improvementsCost = parseFloat(document.getElementById("improvementsCost").value);
var sellingCosts = parseFloat(document.getElementById("sellingCosts").value);
var holdingPeriod = parseFloat(document.getElementById("holdingPeriod").value);
var annualIncome = parseFloat(document.getElementById("annualIncome").value);
var resultDiv = document.getElementById("result");
var resultValueDiv = document.getElementById("result-value");
var taxTypeDiv = document.getElementById("tax-type");
var federalTaxInfoDiv = document.getElementById("federal-tax-info");
var californiaTaxInfoDiv = document.getElementById("california-tax-info");
// Input validation
if (isNaN(purchasePrice) || isNaN(sellingPrice) || isNaN(improvementsCost) || isNaN(sellingCosts) || isNaN(holdingPeriod) || isNaN(annualIncome)) {
alert("Please enter valid numbers for all fields.");
return;
}
if (purchasePrice <= 0 || sellingPrice <= 0 || holdingPeriod <= 0 || annualIncome <= 0) {
alert("Purchase Price, Selling Price, Holding Period, and Annual Income must be positive values.");
return;
}
if (sellingPrice 1;
var taxType = isLongTerm ? "Long-Term Capital Gain" : "Short-Term Capital Gain";
// — Federal Tax Calculation —
var federalLongTermRates = {
threshold_0: 47025, // 2024 Single Filer
threshold_15: 191950, // 2024 Single Filer
rate_0: 0.00,
rate_15: 0.15,
rate_20: 0.20
};
// Simplified federal rates for single filers (adjustments needed for married filing jointly etc.)
var federalTaxableIncome = annualIncome + capitalGain; // Simplified: assumes capital gain is added directly to income for bracket determination
var federalCapitalGainTax = 0;
var federalRate = 0;
if (!isLongTerm) {
// Short-term gains taxed at ordinary income rates (simplified federal brackets)
if (federalTaxableIncome <= 11600) federalRate = 0.10;
else if (federalTaxableIncome <= 47150) federalRate = 0.12;
else if (federalTaxableIncome <= 100525) federalRate = 0.22;
else if (federalTaxableIncome <= 191950) federalRate = 0.24;
else if (federalTaxableIncome <= 243725) federalRate = 0.32;
else if (federalTaxableIncome <= 609350) federalRate = 0.35;
else federalRate = 0.37;
federalCapitalGainTax = capitalGain * federalRate;
federalTaxInfoDiv.innerHTML = `Federal Tax: Short-term gain taxed at ordinary income rate (~${(federalRate * 100).toFixed(1)}%). Estimated Federal Tax: $${federalCapitalGainTax.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`;
} else {
// Long-term gains taxed at preferential rates
if (federalTaxableIncome <= federalLongTermRates.threshold_0) {
federalRate = federalLongTermRates.rate_0;
} else if (federalTaxableIncome <= federalLongTermRates.threshold_15) {
federalRate = federalLongTermRates.rate_15;
} else {
federalRate = federalLongTermRates.rate_20;
}
federalCapitalGainTax = capitalGain * federalRate;
federalTaxInfoDiv.innerHTML = `Federal Tax: Long-term gain taxed at preferential rate (${(federalRate * 100).toFixed(1)}%). Estimated Federal Tax: $${federalCapitalGainTax.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`;
}
// — California Tax Calculation —
// California taxes capital gains as ordinary income, regardless of holding period.
// We need to determine the marginal tax rate based on total income.
var caMarginalRate = 0;
// Simplified CA tax brackets for single filers (2023) – these are progressive
if (annualIncome + capitalGain <= 10412) caMarginalRate = 0.01;
else if (annualIncome + capitalGain <= 24684) caMarginalRate = 0.02;
else if (annualIncome + capitalGain <= 38959) caMarginalRate = 0.04;
else if (annualIncome + capitalGain <= 54081) caMarginalRate = 0.06;
else if (annualIncome + capitalGain <= 68353) caMarginalRate = 0.08;
else if (annualIncome + capitalGain <= 349130) caMarginalRate = 0.093;
else if (annualIncome + capitalGain <= 418953) caMarginalRate = 0.103;
else if (annualIncome + capitalGain <= 628432) caMarginalRate = 0.113;
else if (annualIncome + capitalGain <= 1047389) caMarginalRate = 0.123;
else if (annualIncome + capitalGain <= 1571079) caMarginalRate = 0.133;
else caMarginalRate = 0.133; // Top rate
var californiaCapitalGainTax = capitalGain * caMarginalRate;
californiaTaxInfoDiv.innerHTML = `California Tax: Gain taxed as ordinary income at your marginal rate (~${(caMarginalRate * 100).toFixed(1)}%). Estimated CA Tax: $${californiaCapitalGainTax.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`;
// — Total Tax —
var totalCapitalGainsTax = federalCapitalGainTax + californiaCapitalGainTax;
resultValueDiv.innerText = "$" + totalCapitalGainsTax.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 });
taxTypeDiv.innerText = `Type: ${taxType}`;
resultDiv.style.display = "block";
}