You may feel like you'll be paying off student loans until the day you die. But even that may not be the end of it. It all depends on the

You may feel like you'll be paying off student loans until the day you die. But even that may not be the end of it.

It all depends on the type of loans you have and the lender, says Adam Minsky, a student loan attorney with offices in Boston and New York.

'The first step is to determine if the loan is federal or not,' Minsky says. 'If it's private, then it's more nuanced; it comes down to what the contract says and when the loan was issued.'

Here's what happens to your student debt if you die and what you can do to ensure you won't burden the people left behind.

What happens to your federal loan debt

If you die, your federal student loans will be discharged, meaning no further payments will be required. Your parent, spouse or another person you appoint will need to submit proof of death to your loan servicer. This means an original or copy of the death certificate.

What happens to your private loan debt

If you die with private loan debt, its future will depend on the lender's policy.

Private loans you took out on your own are likely to be forgiven. (Ask your lender about its death discharge policy.) But a private loan that is co-signed by a parent or someone else might not.

Co-signers are just as responsible for the loan as the student is. If the student dies, the co-signer is obligated to repay the loan unless the lender has a policy stating otherwise.

This applies to most existing loans, but not to new loans. All loans taken out after Nov. 20, 2018, must release a co-signer in the event of the student borrower's death, due to a provision in the Economic Growth, Regulatory Relief, and Consumer Protection Act.

If you have a loan that was issued before Nov. 20, 2018, and your lender doesn't have an official discharge policy, there is still recourse. The lender will have a process in place called 'compassionate review' that could still result in your loans being forgiven or co-signer released, says April Query, regional and community services manager for College Foundation of North Carolina. Contact your lender to find out what the process entails.

What happens to your parents' loans

Federal direct PLUS loans will be discharged if a parent borrower or student the PLUS loan was taken out for dies. Proof of death must be submitted to the servicer in the form of an original or copy of the death certificate.

If you have a private parent loan, contact your lender to find out its policy.

No tax implications for now

Unlike some other debt forgiveness programs, death or disability discharge will not trigger a tax bill. The Tax Cuts and Jobs Act of 2017 included a provision that made student debt that is discharged due to death exempt from taxes. This rule is in effect until 2025 and applies to all federal and private student loans.

What you can do

To avoid any headaches for your estate, there are steps to take now to protect your loved ones.

Talk to your parent (or someone else). If you have federal loans, tell your parents who your servicer is and how to contact them so they'll know where to send a death certificate. The same goes for any private debt. It's an uncomfortable talk, but it's necessary.

'Otherwise the parent might not know who to reach out to,' says Query.

If you don't want to burden your parents with this responsibility " 'I could see a parent completely forgetting to go and do that,' says Query " you can ask someone else. She suggests finding a backup family member or friend to submit a death certificate to your servicer. You can ask someone or appoint them officially in your will.

Consider death discharge policy when comparing private loans. This might not make or break your decision, but look for a lender that will discharge all debt for both you and your co-signer.

Check your private lender's policy. If you have existing private debt, your options will depend on your lender's policy. If it has a discharge policy that doesn't include your co-signer, find out if co-signer release is available to get them off your loan for good.

Consider refinancing. You can refinance with a private lender that has co-signer release or a policy of discharging debt for the co-signer in case of death if your current lender doesn't offer this relief.

Take out a larger life insurance policy, as a last resort. If you don't want to refinance or release your co-signer, Minsky suggests taking out a life insurance policy with a payout that your estate can use to cover your remaining debt.

More From NerdWallet

Should You Snap Up a Post-Scandal Volkswagen Diesel? Buy a Real Car Now Before They Become Extinct Wake Up to the Truth About 'Dream Schools'

Anna Helhoski is a writer at NerdWallet. Email: anna@nerdwallet.com. Twitter: @AnnaHelhoski.