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, interest that is taxed twice, 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.00% APR with the prime rate at 7.00% since 17 September 2026). 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 tax on the interest. The loan principal comes out of the account tax-free and is repaid from after-tax pay, which evens out. The interest is different: you pay it into the account from after-tax pay, and it is taxed again as ordinary income when you withdraw it in retirement. On a $40,000 loan repaid over 5 years at 8.50% APR, the interest totals about $9,240, and that is the part taxed twice. 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, many plans offset the unpaid balance against the account. Since 2018 the federal tax rules let you roll the offset amount into an IRA or another plan by your tax-filing deadline for that year, including extensions, which avoids the tax; the IRS page on retirement plan loans sets out the rules. The catch is that you need the cash to do it.
If you cannot roll it over in time, the offset is taxed as a distribution: 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 offset also reduces the 401(k) balance permanently unless it is rolled over by the deadline.
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) left many employees with an outstanding 401(k) loan at the moment their pay stopped. 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 | $792 |
| Total interest paid | $9,240 | $7,546 |
| Who receives the interest | Your own 401(k) | The lender |
| Lost market return | What the fund would have earned on the amount out on loan, minus the interest you pay back in | None |
| Tax deductibility of interest | None | Possible (home improvement use) |
| Job-loss trigger risk | Yes (~$13,600 tax hit) | No |
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.00% with the prime rate at 7.00% since 17 September 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 interest is paid into the account from after-tax pay and is taxed again when withdrawn in retirement. Third, if the borrower leaves the employer with a balance outstanding, many plans offset the unpaid loan against the account; unless the borrower puts that amount into an IRA or plan by the tax-filing deadline (including extensions) for that year, it is taxed as a distribution, with a 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?
Many plans offset the unpaid balance against your account when you leave. You can avoid tax on the offset by rolling the same amount into an IRA or another plan by your tax-filing deadline for that year, including extensions. If you do not, the offset is taxed as a 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.