Many taxpayers think that if they simply don't put something on their tax return, then the IRS will never know about it. But more often than not, there are mechanisms in place that alert the IRS to things that it needs to know about in order to calculate your proper tax liability. That's definitely the case when you leave your job and cash out an old 401(k) retirement account, because even if you don't tell the IRS anything about what you did with your 401(k), your old employer definitely will. Below, we'll take a closer look at how the IRS gets information and what you can do to avoid tax.

What your employer does when you cash out a 401(k)
The IRS knows that taxpayers won't always voluntarily comply with the tax laws, so whenever it can, it builds redundancy into the system. Most taxable income comes from employment, and so dual mechanisms that require both employers and employees to report income items make it far easier for the IRS to double-check on everyone involved and make sure it has complete information.

For retirement accounts, the IRS gets its information from the Form 1099-R that employers are required to complete. The form includes the total amount of money distributed to you, as well as the amount of the distribution that you'll need to include in your taxable income. Your employer also includes any money that it withholds from your distribution to go toward federal and state income tax, and you'll see other information that can be helpful in special circumstances that require additional work to determine what you'll need to report on your tax return.

Apart from the gross distribution and taxable amount boxes, the most important entry on Form 1099-R is the distribution code. If you take a distribution before you turn age 59 1/2, then your 1099-R will typically have code 1, which corresponds to an early distribution for which no known exception to the 10% penalty applies. For 401(k)s, if your employer knows that you have separated from service and are at least 55, then a penalty exception applies, and code 2 will be marked. For those who are 59 1/2 or older, you'll typically see code 7, which is used for a normal distribution.

The legal way to avoid tax
Because the taxable amount is on the 1099-R, you can't just leave your cashed-out 401(k) proceeds off your tax return. The IRS will know and you will trigger an audit or other IRS scrutiny if you don't include it.

However, there are a couple things you can do. If you haven't yet left work, simply don't cash out your 401(k). Either leave it at your employer or arrange to have it transferred directly to a rollover IRA or your new 401(k) account at your new job. That avoids taxation, and you won't even get a 1099-R.

Alternatively, if you already have the cash but it's still within 60 days since you got it, you can roll it over yourself into a new IRA. You'll get a 1099-R in this case, but you still won't owe tax as long as you meet the rollover rules.

If you cash in your 401(k), the IRS will know. So don't try to cheat your way out of paying tax. Instead, do the smart thing and keep your retirement money where it belongs.

This article is part of The Motley Fool's Knowledge Center, which was created based on the collected wisdom of a fantastic community of investors. We'd love to hear your questions, thoughts, and opinions on the Knowledge Center in general or this page in particular. Your input will help us help the world invest, better! Email us at [email protected]. Thanks -- and Fool on!