If you're paying your nanny cash under the table, you might catch heat from the IRS.

It's no secret that child-care costs are a massive expense for working parents. Families with infants pay a nanny an average of $580 a week, according to Care.com — or $30,160 annually.

To put things into perspective, average tuition, fees, room and board adds up to $21,370 at a public four-year school and $48,510 at a private four-year school for the 2018-2019 tax year, according to the College Board.

It may be tempting to slip your caregiver some cash off the books, but you're taking a chance with the IRS for failure to pay the appropriate employment taxes.

"It doesn't make sense to risk financial consequences in terms of penalties and tax problems or even getting a felony tax evasion charge," said Tom Breedlove, senior director of Care.com HomePay.

In fact, failing to pay your household workers the right way could hurt you at work, too.

Consider the so-called Nannygate controversy back in the 1990s surrounding President Bill Clinton's picks for attorney general, Zoe Baird and Judge Kimba M. Wood. Both women came under fire for the way they hired and paid their child-care helpers.

Most recently, Heather Nauert, a State Department spokeswoman who recently removed herself from consideration to be the next U.S. ambassador to the United Nations, also reportedly had a nanny tax issue.

Here's what you need to know about paying your nanny on the books and what it means for your taxes.