This calculator provides estimates for educational purposes only. It is not affiliated with any bank, lender, or financial institution. Results are not a loan offer or guarantee of terms. Consult a licensed mortgage professional for advice specific to your situation.
HELOC vs 401(k) Loan
A 401(k) loan looks cheaper than a HELOC on paper because you pay the interest back to your own account. The hidden costs are lost market returns on the borrowed amount, double-taxation of the principal, and the job-loss trigger that can convert the outstanding balance into a taxable distribution. The HELOC is usually the safer and often the cheaper choice once the full math is run.
The 401(k) loan mechanics
A 401(k) loan is a borrowing facility offered by approximately 80% of employer-sponsored 401(k) plans in the US. The IRS rules cap the loan amount at the lesser of 50% of vested balance or $50,000. The interest rate is set by the plan, typically prime plus 1% (so 8.50% APR as of May 2026 with prime at 7.50%). The repayment term is generally 5 years (60 monthly payments), longer for loans used to purchase a primary residence at some plans. Repayments come from after-tax payroll deductions.
The most-cited feature of the 401(k) loan is that the interest is paid back into the borrower's own account. This framing ("you pay yourself the interest") makes the loan appear free or nearly free. The framing is misleading because it ignores the opportunity cost. While the borrowed principal is outside the 401(k), it does not earn investment returns. If the market returns 8% during the loan period and the borrower borrowed $40,000 for 5 years, the lost compounding return is substantial: roughly $19,000 of foregone growth at compound 8% over 5 years on the borrowed principal. That lost return offsets and often exceeds the "saved" interest from the pay-yourself structure.
A subtler issue is the double-taxation of the repayments. The principal repayments come from after-tax payroll income, then get taxed again when withdrawn in retirement under standard 401(k) distribution rules. The interest payments are similarly after-tax going in, taxed again going out. For a $40,000 loan repaid over 5 years with $8,800 of total interest paid (at 8.50% APR), the cumulative double-taxed amount is the full $48,800. At a 24% marginal rate going in and 22% effective rate coming out in retirement, the double-tax friction adds 5% to 8% of effective borrowing cost on top of the headline interest rate. The all-in cost of a 401(k) loan is rarely the "free" advertised by the pay-yourself framing.
The job-loss trigger
The most consequential risk specific to 401(k) loans is the separation-from-service trigger. If the borrower leaves the employer (voluntarily through resignation or involuntarily through layoff or termination) with the loan outstanding, the plan typically requires full repayment within 60 to 90 days. The IRS guidance under the SECURE Act extends the deadline at some plans to the participant's next tax-filing deadline (including extensions), which gives 6 to 16 additional months depending on timing, but the original 60 to 90 day window remains standard at many plans.
Failure to repay within the deadline triggers a "deemed distribution" for tax purposes: the outstanding loan balance is treated as if the borrower withdrew it from the 401(k). For a borrower under age 59 and a half, this triggers ordinary income tax on the full balance plus a 10% early- withdrawal penalty. For a $40,000 outstanding loan, the tax hit is $13,600 at a 24% federal marginal rate (ignoring state tax, which adds more). The deemed distribution also reduces the 401(k) balance permanently; the borrower cannot "repay" the deemed distribution to restore the lost balance.
For a borrower with stable, long-tenured employment in an industry with low layoff risk, the job-loss trigger is mostly theoretical. For a borrower in an industry with cyclical layoffs (tech, finance, energy, retail), the trigger is a real risk that should weigh heavily in the decision. The past two cycles of tech-industry layoffs (2022 to 2023 and recent waves in 2024 to 2025) saw many employees discover that their 401(k) loans became immediately due upon separation, with several months' severance pay consumed by loan repayment instead of bridging to a new role. The HELOC has no equivalent trigger: a HELOC stays in place regardless of employment status (though future credit availability could be affected by income loss).
Full-cost comparison: $40,000 borrowed, 5-year horizon
| Cost component | 401(k) loan at 8.5% | HELOC at 7.02% |
|---|---|---|
| Monthly payment | $821 | $793 |
| Total interest paid | $9,234 | $7,571 |
| Lost market return (8% on $40k) | ~$19,000 | $0 |
| Tax deductibility of interest | None | Possible (home improvement use) |
| Job-loss trigger risk | Yes (~$13,600 tax hit) | No |
| Effective total cost | ~$28,234 + trigger risk | $7,571 (or less w/ deduction) |
When the 401(k) loan still wins
Despite the long list of drawbacks, the 401(k) loan can be the right choice in specific narrow scenarios. First, when the borrower has insufficient home equity to qualify for a HELOC. A homeowner with only 5% equity in their home has no HELOC option (most lenders cap at 80% to 95% CLTV), so the 401(k) loan is the only home-asset-adjacent borrowing route. Second, when the borrower has very short-term borrowing needs (less than 18 months) and high confidence in stable employment over that window. The compressed timeline limits the lost-market-return cost and the job-loss exposure.
Third, when the alternative is a credit card or personal loan at 18% to 28% APR for a borrower who cannot qualify for a HELOC. The 401(k) loan at 8.5% is unambiguously cheaper than the high-rate unsecured alternative even after accounting for lost market returns. Fourth, when the borrower has a specific tactical use of funds (e.g. paying off high-rate credit-card debt) that produces an immediate financial benefit larger than the 401(k) loan's effective cost. A borrower carrying $25,000 of credit-card debt at 24% APR who takes a $25,000 401(k) loan to pay it off, then repays the 401(k) loan via payroll deduction, captures real savings even after the lost-market-return offset.
Outside these narrow scenarios, the HELOC is usually the better choice. The HELOC has lower effective cost once lost market returns and tax effects are factored in, lower risk profile (no job-loss trigger, no deemed-distribution risk), and the option of tax deductibility when used for home improvement. For most homeowners with sufficient equity, the HELOC dominates the 401(k) loan on substantially all financial dimensions.
Frequently asked questions
How much can I borrow from my 401(k)?
Under IRS rules, the maximum 401(k) loan is the lesser of 50% of your vested balance or $50,000. A participant with $100,000 vested can borrow up to $50,000; a participant with $80,000 vested can borrow up to $40,000. Plan-specific rules may further restrict the amount. The loan must be repaid within 5 years (longer for primary-residence purchases at some plans).
What is the interest rate on a 401(k) loan?
Plan-set, typically prime plus 1% (so 8.50% as of May 2026). The interest is paid back to the borrower's own 401(k) account, not to a third-party lender. This is the source of the 'pay yourself back' framing, but the loan still carries real costs in the form of lost market returns on the borrowed amount.
What is the hidden cost of a 401(k) loan?
Three hidden costs. First, the borrowed amount is removed from the market while the loan is outstanding; if the market returns 8% during the loan period, the borrower misses that return on the loaned principal. Second, the repayments come from after-tax income but get taxed again at withdrawal in retirement, creating double-taxation on the loan principal. Third, if the borrower leaves the employer (voluntarily or otherwise), the loan typically becomes due in full within 60 to 90 days; failure to repay triggers a deemed distribution with income tax and 10% early-withdrawal penalty if under 59 and a half.
When does a 401(k) loan beat a HELOC?
Rarely on a pure financial-math basis. The 401(k) loan can beat a HELOC when the borrower has insufficient home equity for a HELOC, has stable employment they are confident will continue for the full repayment period, and is borrowing for a use that would otherwise require a high-rate unsecured loan or credit card. Even then, the math is closer than the 'pay yourself back' framing suggests.
What happens if I leave my job with a 401(k) loan outstanding?
Most plans require the loan to be repaid within 60 to 90 days of separation (some plans give until the next tax-filing deadline under the SECURE Act extension). If unpaid by the deadline, the outstanding balance is treated as a deemed distribution: full ordinary income tax on the balance plus a 10% early-withdrawal penalty if under 59 and a half. On a $40,000 outstanding loan for a borrower in the 24% bracket under 59 and a half, the tax hit is $13,600 (24% income tax plus 10% penalty).
Can I use both a HELOC and a 401(k) loan?
Yes, mechanically. They are separate facilities under different regulatory regimes. The HELOC is a consumer credit product secured by your home; the 401(k) loan is a plan-permitted loan from your retirement balance. Some borrowers split a large funding need across both to keep each loan smaller and reduce the risks specific to each. Most financial advisors would steer borrowers to the HELOC first and use the 401(k) loan only if needed for the gap.