Unimolecular fragmentation patterns of the molecular ions of selected lactams and sultams bearing alkoxymethyl group at the nitrogen atom were studied. The main common fragmentation reaction observed for all compounds studied in this work is the elimination of an aldehyde molecule. This reaction is considered to proceed via two different mechanisms. For lactams, hydrogen rearrangement within an alkoxymethyl group is observed, which leads to the appropriate N-methyl derivatives. For sultams, transfer of the methyl group to the nitrogen and oxygen atoms, proceeding through an ion-neutral complex, dominates. Another important fragmentation channel characteristic exclusively for lactams is the loss of an alkyl radical. This process takes place within the N-alkoxymethyl moiety, yielding the appropriate protonated ion of N-formyllactams. This process is accompanied by relatively high kinetic energy release.