If you have a Roth IRA, you probably know that the money you contribute to this account is post-tax. You pay taxes in the year you make the contribution, and after that, the money grows tax-free. While this is the gist of how these accounts work, there are a few Roth rules you need to know.

One of them is the Five-Year Rule. Failing to abide by it could result in the government taxing you on any investment earnings, even though the money in the account is supposed to be tax-free. The Five-Year Rule can seriously impact your retirement savings, so learn more about it below.

Stopwatch lying on top of money

Image source: Getty Images.

How does the Five-Year-Rule rule work?

The Five-Year Rule states that if you make a Roth IRA withdrawal and it's been less than five years since your first contribution to any Roth IRA, the government may charge you income tax, plus a 10% early withdrawal penalty if you're under 59 1/2. It's a little more complex than it sounds, though.

First, the government can only tax any investment earnings you withdraw, not your initial contributions (unless you're under 59 1/2), because you've already paid taxes on that money. There's no need to specify that you want your contributions withdrawn and not your investment earnings because the government determines which order money comes out of the account. Your Roth IRA contributions go first, then any rollover or conversion contributions, and finally, investment earnings.

The other thing that makes this tricky is that the five-year clock begins in the tax year that you made the contribution for, not necessarily in the year you made the contribution. For example, if you make your first Roth IRA contribution before April 15, 2020, you can elect to make it for the 2019 tax year or 2020. If you make it for 2019, you'll be eligible to withdraw any Roth IRA earnings tax-free on Jan. 1, 2024, because the clock starts on Jan. 1 of the tax year of the contribution -- in this case, 2019. But if you make the same contribution for the 2020 tax year instead, you would now have to wait until Jan. 1, 2025, to make penalty-free earnings withdrawals.

The rule doesn't apply to every single contribution you make to your Roth IRA or to every Roth IRA you own. As long as five years have passed since your first contribution to your first Roth IRA, you can withdraw your money from these accounts tax-free, even if your latest contribution was only a few days ago or if you're withdrawing money from an account you've held for only a few years.

The one exception is a Roth IRA conversion. That follows a different Five-Year Rule. Each conversion has its own five-year clock, and like the standard Five-Year Rule, it begins on Jan. 1 of the year you make the conversion. Your Roth IRA conversions always count for the current year. There is no way to apply it to the prior tax year, even if you do so before the annual tax deadline. If you take the converted funds out less than five years after the conversion, you'll owe a 10% early withdrawal penalty if you're under 59 1/2, unless it's for a qualifying reason like a first-home purchase. You can cut down on the amount of time you have to wait before you can access these funds by doing the conversion in December. This way, you're shaving almost a year off your waiting time.

What happens if you violate the Five-Year Rule

If you disregard the Five-Year Rule and withdraw earnings from your Roth IRA that you have not held for at least five years, you will pay taxes on your earnings. Again, you will not pay taxes on your contributions, because you already did. However, if you're under 59 1/2, you could still be subject to a 10% early withdrawal penalty on contributions you withdraw.

There are exceptions to the 10% early withdrawal penalty if you take the money for a qualified reason, like a first-home purchase up to $10,000 or qualified educational expenses. But this doesn't exempt you from following the Five-Year Rule. You still cannot take out more than your personal contributions without paying income tax on your earnings unless it's been at least five years since your first Roth IRA contribution.

The Five-Year Rule shouldn't pose an issue for most people, especially if you don't plan on touching the money until retirement. But if you're considering opening a Roth IRA within a few years of your retirement, it's a good idea to stop and consider how the rule could affect you. You may want to leave your Roth IRA alone for a little bit until you are sure you are past the five-year mark. Or else if you are going to start tapping it right away in retirement, make sure you limit yourself to only as much as you have personally contributed.

The whole point of a Roth IRA is to help you reduce the amount of taxes you owe in retirement. As long as you abide by the Five-Year Rule, you shouldn't have any trouble with that. Just understand the rule so you don't accidentally cost yourself money.