Tax Return Estimator

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()}
`; const pdfTemplate = document.getElementById('pdf-template'); pdfTemplate.innerHTML = reportHtml; pdfTemplate.classList.remove('invisible'); try { const { jsPDF } = window.jspdf; const canvas = await html2canvas(pdfTemplate.querySelector('.pdf-report-container'), { scale: 2 }); const imgData = canvas.toDataURL('image/png'); const pdf = new jsPDF({ orientation: 'p', unit: 'pt', format: 'a4' }); const pdfWidth = pdf.internal.pageSize.getWidth(); const pdfHeight = (canvas.height * pdfWidth) / canvas.width; pdf.addImage(imgData, 'PNG', 0, 0, pdfWidth, pdfHeight); pdf.save('Tax_Return_Estimate.pdf'); } catch(e) { console.error('PDF Generation Error:', e); } finally { downloadPdfBtn.disabled = false; downloadPdfBtn.textContent = 'Download Tax Summary'; pdfTemplate.classList.add('invisible'); } } downloadPdfBtn.addEventListener('click', generatePdfReport); // --- INITIALIZATION --- switchTab(0); });
Scroll to Top