Annual limits on 401(k) contributions if you are not employed the entire year

The IRS says:

Highlights of limitations that remain unchanged from 2016

The contribution limit for employees who participate in 401(k), 403(b), most 457 plans, and the federal government’s Thrift Savings Plan remains unchanged at $18,000.

The catch-up contribution limit for employees aged 50 and over who participate in 401(k), 403(b), most 457 plans, and the federal government’s Thrift Savings Plan remains unchanged at $6,000.

What if you are not employed the entire year? My wife will be retiring from her company at the end of March and may not return to work elsewhere. Is her maximum contribution still 18K/6K, or is it pro-rated based on the portion of the year she is working for that employer?

I believe it’s just limited by how much she earned while she was working. If she only earned $12K, she can’t put more than that into a 401k.

I know that’s how it worked for IRA contributions. I can’t find chapter and verse in the regs to cite, tho.

It’s an annual contribution, so she could contribute the entire $18k in January* and then retire if she wants to. If she goes back to work, she can’t contribute any more until next year, obviously.

*If her wages are high enough and her employer’s plan allows her to contribute at a sufficient %.