Invest in You: Ready. Set. Grow.

Here's what happens to your 401(k) loan if you are laid off

As inflation continues to surge, hitting 8.5% in the U.S. in March, it's important find ways to protect your savings.

If you've taken out a loan against your 401(k) savings account and lose your job, it could generate an unexpected tax bill.

While recent economic rescue legislation provided some relief for coronavirus-related 401(k) loans, they still are subject to certain existing rules when you separate from your company, whether by choice or not. And that borrowed money could morph into a taxable distribution that comes with an early withdrawal penalty.

As the coronavirus pandemic continues to inflict pain on the U.S. economy and job losses mount, some workers may be hitting the unemployment line with a 401(k) loan in tow. Vanguard's 2019 How America Saves report shows that 13% of 401(k) savers have an outstanding loan.

More from Invest in You:
5 things super savers do that you can actually learn
Coronavirus pandemic is a 'defining moment' for Gen Z
Here's how to land a work-from-home job

The average balance on those loans — most common among workers with income from $30,000 to $100,000 — is $9,900. About 78% of plans allow such loans, whose repayment terms are usually five years. The interest rate on 401(k) loans is typically the prime rate plus 1 or 2 percentage points. 

Federal law allows workers to borrow up to 50% of their account balance, with a maximum of $50,000 (the CARES Act temporarily increased that to $100,000 for individuals who are financially impacted by the pandemic). The loan is tax-free and, unlike with most outright distributions, there is no early withdrawal penalty of 10% if you're under age 59½.

However, if you leave your job — whether by choice or not — there's a good chance your plan will require you to repay the money back fairly quickly; otherwise, your account balance will be reduced by the amount owed and considered a distribution.

Unless you are able to come up with that amount and put it in a qualifying retirement account within a set amount of time, that distribution is taxable. And, if you are under age 55 when you leave the job, you'll pay a 10% early withdrawal penalty. Workers who leave their company when they reach that age are subject to different withdrawal rules for 401(k) plans.

"A participant who does not repay an outstanding loan will be taxed on the loan as if it were a cash distribution," said Marcia Wagner, founder of The Wagner Law Group and an expert in employee benefits.

You get until Tax Day the following year to replace the amount — i.e., if you are laid off in June 2020, you get until April 15, 2021, to come up with the funds. Prior to major tax law changes that took effect in 2018, participants only had 60 days.

Although most employers won't let you continue paying the loan after you leave the company, it's worthwhile checking on the policy for your plan.

Here's what you should be doing with your 401(k) during the coronavirus
What to do with your 401(k) during the pandemic

"It's not common, but it is possible," said certified financial planner Jeffrey Levine, director of advanced planning at Buckingham Wealth Partners on New York's Long Island.

If you are permitted to continue repaying after you leave the company — and your loan was coronavirus-related under the CARES Act — you might get an extra year to repay (i.e., six instead of the typical five). The legislation allows 401(k) borrowers to defer payments for a year, so that reprieve could possibly extend to ex-employees, as well, Levine said.

"An ex-employee theoretically could get that extra year if the plan allows it," Levine said.

Be aware that if you are able to defer paying for a year, interest on the loan would continue to accrue. And, the payment amount after the deferral would change to reflect both the amount deferred and the accrued interest.

SIGN UP: Money 101 is an 8-week learning course to financial freedom, delivered weekly to your inbox.

CHECK OUT: If you invested $500 in 2010 according to Warren Buffett's advice, here's how much you'd have now via Grow with Acorns+CNBC.

Disclosure: NBCUniversal and Comcast Ventures are investors in Acorns.