It's not uncommon to land on a target retirement age at some point during your career. Maybe the age you'll decide on is 65. Maybe it's 67. Or maybe, if you love what you do, you'll aim to keep working well into your 70s.

It's one thing to plan on working until a certain age. Maintaining that plan in practice may be trickier than expected. That's because sometimes, companies have a sneaky way of forcing older workers into retirement, even though they're not supposed to. That's something you may want to plan for, just in case.

A person with a serious expression looking at a laptop.

Image source: Getty Images.

It's not just a matter of legality

Generally speaking, it's illegal to force someone out of a job on the basis of age. In certain limited exceptions, companies may have written rules in place for CEOs or board members that prohibit them from holding those positions beyond a certain age. But for the typical worker, it's illegal for an employer to force them to stop doing their job once a specific birthday arrives.

However, just because it's generally illegal to force someone into retirement doesn't mean companies don't do it. Yours might effectively force you to stop working by relegating you to a role you're unhappy with or piling on the work to the point where it's not sustainable. Your company might also do things like cut your pay, or employ other such tactics with the goal of driving you out.

Why would your company want to do something like that if you're good at what you do? It's simple.

It's often the case that seasoned employees earn higher paychecks than newbies. So if your company is able to force you into retirement at age 62, a few years ahead of your planned workforce exit, it might then be in a position to replace your $120,000 annual salary with a $45,000 paycheck for someone a few years out of college.

Worse yet, proving that your company has discriminated against you due to your age can be difficult. So even if your employer's actions seem blatantly wrong to you, winning a case in court may be a different story.

You may want to plan for an early retirement

It's one thing to be forced into retirement a few years early when you're already sitting on a 401(k) or IRA worth $2 million. But forced retirement becomes more problematic when you're lacking in savings and are counting on your last few years in the workforce to catch up.

That's why a really good bet is to save aggressively for retirement throughout your working years. In fact, one thing you don't want to do is bank on playing catch-up at the very end of your career, because you never know when you might be forced into retirement due to circumstances having nothing to do with your employer, like health issues.

If you fund a 401(k) or IRA steadily year after year, then chances are, by the time you reach an age when your company might try to push you to retire, you'll already have a nice nest egg to fall back on. And while that doesn't completely soften the blow of being forced out of the job you've committed yourself to, it might help to some degree.