The gas-phase reactivity of CH3NHOCH3 (N,O-dimethylhydroxylamine, DHA) and NH2OCH3 (O-methylhydroxylamine, MHA) toward a series of anionic bases has been studied using the method of Fourier transform ion cyclotron resonance (FT-ICR) mass spectrometry. Both DHA and MHA undergo a competing proton abstraction from and nucleophilic substitution reaction on the nitrogen atom. The competition between these processes is governed by the strength of the base used. Unexpectedly, the nucleophilic attack on the nitrogen atom leading to the substitution of the methoxy group is found to be a relatively facile process. This is especially evident in the substitution reactions with O-methylhydroxylamine, NH2OCH3, where the formation of methoxide ions is much more efficient than in the highly inefficient substitution reactions of dimethyl ether, CH3OCH3. Apparently, substitution reactions on the nitrogen atom do not suffer from a very unfavorable activation barrier which is assumed to hamper nucleophilic substitution reactions on carbon atoms in the gas phase. This seems to be supported by high-level density-functional (DF) calculations which indicate that the nucleophilic substitution reactions on the nitrogen atom proceed via an entropically favored less tight, S(N)1-like transition state. However, in the reactions of N,O-dimethylhydroxylamine, Ch3NHOCH3, the proton abstraction and substitution processes unfavorably compete with a base-induced imine-forming 1,2-elimination. The efficiency of the imine-forming elimination reactions of CH3NHOCH3 can be compared favorably with the efficiency of base-induced alkene-forming 1,2-elimination reactions of corresponding simple ethers such as CH3CH2OC2H5.