401(k) vs. IRA Contribution Maximizer

Your Details

Current Year IRS Contribution Limits (Verify These Annually)

401(k) Employer Match Details

Enter how your employer's 401(k) match works:

E.g., if employer matches 50% of your contributions up to 6% of your salary, enter 50 and 6.

IRA Preference

Note: IRA contribution eligibility (especially for Roth IRA or deductible Traditional IRA) depends on your Modified Adjusted Gross Income (MAGI) and other factors not assessed by this tool. Please verify your eligibility separately.

Recommended Contribution Strategy

Please complete the previous steps and click "Calculate Strategy" to see your results.

2. Employer Match Received: $${employerMatchReceived.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2})}

3. Recommended ${iraTypeDisplay} Contribution: $${allocatedToIra.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2})}


Total Your Contributions: $${totalUserContributions.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2})}

Total Retirement Account Deposits (Your Contributions + Match): $${totalRetirementDeposits.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2})}

${savingsRemainingUnallocated > 0 ? `

Amount of Planned Savings Remaining (consider taxable account): $${savingsRemainingUnallocated.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2})}

` : ''} ${(allocatedTo401k >= actual401kLimit && allocatedToIra >= actualIraLimit && vals.amountToSave > totalUserContributions) ? `

Congratulations! You've maxed out both your 401(k) and IRA contributions based on the limits provided!

` : ''} `; notesContainerEl.style.display = 'block'; downloadPdfBtn.style.display = 'block'; }); // PDF Download downloadPdfBtn?.addEventListener('click', function () { const { jsPDF } = window.jspdf; const pdfOutputArea = document.getElementById('cmPdfOutputArea'); if (!pdfOutputArea || resultsSummaryEl.innerHTML.includes("Please complete the previous steps")) { alert('Please calculate the strategy first before downloading PDF.'); return; } html2canvas(pdfOutputArea, { scale: 1.5, useCORS: true, backgroundColor: '#ffffff' }) .then(canvas => { const imgData = canvas.toDataURL('image/jpeg', 0.85); const pdf = new jsPDF({ orientation: 'portrait', unit: 'pt', format: 'a4' }); const pdfWidth = pdf.internal.pageSize.getWidth(); const pdfHeight = pdf.internal.pageSize.getHeight(); const margin = 30; const contentWidth = pdfWidth - 2 * margin; const canvasWidth = canvas.width; const canvasHeight = canvas.height; const ratio = canvasWidth / canvasHeight; let imgWidth = contentWidth; let imgHeight = imgWidth / ratio; if (imgHeight > pdfHeight - 2 * margin) { imgHeight = pdfHeight - 2 * margin; imgWidth = imgHeight * ratio; } pdf.addImage(imgData, 'JPEG', margin, margin, imgWidth, imgHeight, undefined, 'MEDIUM'); pdf.save('Retirement_Contribution_Strategy.pdf'); }) .catch(err => { console.error("Error generating PDF:", err); alert("Error generating PDF. See console for details."); }); }); // Initial Setup switchTab('detailsTab'); // Start on the first tab });
Scroll to Top