The limit on contributions to an individual's 401k was $18,000 in 2017, and if a person accidentally pays too much into the account, it is crucial to correct the error to avoid paying extra taxes, according to Nerdwallet. This limit only applies to the pre-tax wages that an employee contributes to their plan and won't count any employer matches.
To fix the mistake, contact the plan administrator and let them know that you have made an 'excess deferral,' which will let them know the current situation. From here, they are required to return the money back to you in a 'corrective distribution' that accounts for any additional earnings that this money might have made. It can take time for administrators to process this request and issue a new W-2 so reach out to them early to avoid filing taxes after the deadline.
