Capital Gains Tax Calculator
Calculate taxes on your investment profits with our free capital gains calculator. Understanding the difference between short-term and long-term capital gains rates can significantly impact your investment strategy and tax planning.
2024 Capital Gains Tax Rates
| Tax Type | Single Filer Income | Rate |
|---|---|---|
| Short-term (held < 1 year) | Any income | Ordinary income rates (10-37%) |
| Long-term (held 1+ years) | $0 - $47,025 | 0% |
| Long-term | $47,026 - $518,900 | 15% |
| Long-term | Over $518,900 | 20% |
| Collectibles | Any | 28% maximum |
| NIIT Surcharge | Over $200,000 | +3.8% |
Short-Term vs Long-Term Gains
| Example: $10,000 Gain | 22% Tax Bracket | 32% Tax Bracket |
|---|---|---|
| Short-term tax | $2,200 | $3,200 |
| Long-term tax | $1,500 | $1,500 |
| Savings by holding 1+ year | $700 | $1,700 |
Capital Gains Calculator
``javascript
function calculateCapitalGains(purchasePrice, salePrice, holdingMonths, taxableIncome) {
const gain = salePrice - purchasePrice;
const isLongTerm = holdingMonths >= 12;
let taxRate;
if (!isLongTerm) {
// Short-term: use ordinary income rate (simplified)
taxRate = taxableIncome > 191950 ? 0.32 :
taxableIncome > 100525 ? 0.24 :
taxableIncome > 47150 ? 0.22 : 0.12;
} else {
// Long-term rates (2024 single filer)
taxRate = taxableIncome > 518900 ? 0.20 :
taxableIncome > 47025 ? 0.15 : 0;
}
// Net Investment Income Tax for high earners
const niit = taxableIncome > 200000 ? gain * 0.038 : 0;
const capitalGainsTax = gain * taxRate + niit;
return {
gain: gain.toFixed(2),
holdingPeriod: isLongTerm ? 'Long-term' : 'Short-term',
taxRate: (taxRate * 100).toFixed(0) + '%',
capitalGainsTax: capitalGainsTax.toFixed(2),
netProfit: (gain - capitalGainsTax).toFixed(2)
};
}
``
Tax-Loss Harvesting
Offset capital gains by selling investments at a loss. Up to $3,000 in net losses can offset ordinary income annually, with excess carried forward. Strategic loss harvesting near year-end can reduce your tax bill significantly.