Tax Return Estimator
Estimate your 2025 federal tax refund or amount owed. Based on 2024 tax law.
Your Filing Information
Annual Income
Deductions & Credits
Your standard deduction will be calculated automatically based on your filing status. For this estimator, we will use the standard deduction.
$${Math.abs(finalAmount).toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 })}
${renderDetailRow('Total Income:', calculationResults.totalIncome)}
${renderDetailRow('Standard Deduction:', calculationResults.deduction, '-')}
${renderDetailRow('Taxable Income:', calculationResults.taxableIncome)}
${renderDetailRow('Estimated Tax Liability:', calculationResults.taxLiability)}
${renderDetailRow('Tax Credits:', calculationResults.credits, '-')}
${renderDetailRow('Total Tax:', calculationResults.totalTax)}
${renderDetailRow('Tax Withheld:', calculationResults.taxWithheld, '-')}
`;
}
function renderDetailRow(label, amount, sign = '') {
return `
${label}
${sign}$${amount.toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 })}
`;
}
// --- PDF GENERATION ---
async function generatePdfReport() {
downloadPdfBtn.disabled = true;
downloadPdfBtn.textContent = 'Generating...';
const { finalAmount } = calculationResults;
const isRefund = finalAmount >= 0;
const resultText = isRefund ? 'Estimated Refund' : 'Amount Owed';
const resultColor = isRefund ? '#166534' : '#991b1b'; // green-800, red-800
const reportHtml = `
Tax Summary Report
An estimate for the 2025 tax year based on 2024 tax law.
${resultText}
$${Math.abs(finalAmount).toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 })}
Calculation Details
| Total Income | $${calculationResults.totalIncome.toLocaleString()} |
| Standard Deduction | -$${calculationResults.deduction.toLocaleString()} |
| Taxable Income | $${calculationResults.taxableIncome.toLocaleString()} |
| Tax Liability Estimate | $${calculationResults.taxLiability.toLocaleString(undefined, {minimumFractionDigits:2})} |
| Tax Credits | -$${calculationResults.credits.toLocaleString()} |
| Total Estimated Tax | $${calculationResults.totalTax.toLocaleString(undefined, {minimumFractionDigits:2})} |
| Federal Tax Withheld | -$${calculationResults.taxWithheld.toLocaleString()} |
This is an estimate for informational purposes only. Consult a tax professional for advice.
