If you made a contribution to a Roth IRA or traditional IRA, you can switch the type of IRA by doing a recharacterization through October 15 of the year after you made the original contribution. This treats the contribution as if it was made to the other type of IRA in the first place. This is useful for correcting a contribution that you later discovered you were not allowed to make or it went into the wrong kind of IRA.
Timing of recharacterization
For the timing in the case where an excess Roth contribution was made in one year, for example in 2016, it can be recharacterized to a traditional IRA up to October 15, 2017, the six-month extension period for filing 2016 returns. In this case, the contribution to the traditional IRA can be converted to Roth as soon as the day following the recharacterization.
How to recharacterize
To make a recharacterization, notify the custodian of the IRA (Vanguard, for example) which transaction you want to recharacterize. The amount which is recharacterized will be adjusted by them for any earnings or losses on the IRA since the contribution; your custodian computes the earnings for you and transfers the proper amount to the other type of IRA. However, for tax purposes, it is treated as if the original amount was contributed; for example, if you contributed $5000 to a Roth IRA, the Roth IRA declined in value to $4000, and you recharacterize the contribution as a Traditional IRA contribution and are eligible for a deduction, you may deduct $5000 as an IRA contribution for the year.
If you filed your tax return by April 15 of the year following the contribution (or applied for an extension at the time), you may recharacterize until October 15 of that year. If you recharacterize after April 15, write "Filed pursuant to section 301.9100-2" on your amended return.
The recharacterization may change your taxes for the year of the original contribution, even if you recharacterized in the following year. If you have already filed a tax return for the year of the contribution, you must file an amended return. If you recharacterized a Roth IRA contribution as a deductible IRA contribution, you will receive a refund. If you recharacterized a deductible IRA contribution as a Roth IRA contribution, you will owe extra tax. If you recharacterized a non-deductible IRA to a Roth IRA or vice versa, your tax owed will not change, but you still need to amend the return to correct your IRS Form 8606, Nondeductible IRAs. (In this case, Form 8606 may be mailed in by itself since there was no change to the taxes owed.)
How to save taxes by recharacterizing
Changing type of IRA contribution
If you contributed to a deductible IRA and its value rose, you can benefit by recharacterizing rather than converting directly to a Roth. If you contributed to a Roth IRA and its value fell, you can benefit by recharacterizing if you are eligible for a traditional IRA. This is still allowed under the 2018 tax law.
Example: You contributed $5000 to a deductible Traditional IRA in March 2019, and expected to reduce your taxes by $1100 because you were in a 22% tax bracket. In January 2020, with the Traditional IRA now worth $7000, you decide that a Roth IRA would have been better. If you convert the Traditional IRA to a Roth, you would get an $1100 tax reduction for 2019 but owe $1540 on the conversion for 2020. But if you recharacterize the 2019 contribution as a Roth contribution, you save $440 in taxes.
Example: You contributed $5000 to a Roth IRA in April 2019 even though you were eligible for a deductible IRA. In October 2020, your Roth has lost 40% of its value. You recharacterize the contribution, then worth $3,000, as a Traditional IRA contribution, filing an amended return, and receive an $1100 refund because you are are in a 22% tax bracket. You wait until January 2021 in order to postpone taxes for another year, then convert the Traditional IRA, which is still worth $3000, back to a Roth IRA; you will owe $660 in taxes for 2021 on the conversion, saving $440 in taxes.
Different tax brackets
If you can undo a taxable contribution and redo it in a year in which you are in a lower tax bracket, you may benefit even if the market does not move.
Example: You contributed $5,000 to a Roth in 2018, when you were in the 24% bracket. When doing your taxes in February 2019, you learn that your income was too high to contribute to a Roth. You expect little income in 2019 and decide to pay the taxes at your lower 10% rate instead. Since you didn't have access to an employer retirement plan in 2018, you recharacterize the contribution to a traditional IRA and take a deduction on your 2018 tax return, saving $1,200 in taxes. In February 2019, the traditional IRA is worth $5,300 so you then convert it back to the Roth a few days later and pay $530 on the conversion. You saved $670 in taxes.
Missing the deadline
The IRS will consider relief for taxpayers who belatedly discover that they are ineligible for making a contribution, especially when these are errors made in good faith, and are reported prior to the IRS uncovering the error (under Reg.301.9100-1).
Furthermore, both the Congress and the IRS sometimes grant extensions for disaster relief for victims of disasters. 
- "Publication 590-A, Contributions to Individual Retirement Arrangements (IRAs)". IRS. http://www.irs.gov/publications/p590a/. Retrieved 7 February 2016.
- 26 CFR 301.9100-1 - Extensions of time to make elections, Legal Information Institute, Cornell University Law School.
- Choate, Natalie, Life and Death Planning for retirement plans, sixth edition, 2006, pp. 255-256.
- Fairmark's Roth IRA Guide: Recharacterizations
- Publication 590-B, Distributions from Individual Retirement Arrangements (IRAs), (PDF)