Synthesis of 3-methoxyazetidines via an aziridine to azetidine rearrangement and theoretical rationalization of the reaction mechanism.