The purpose of this study was to elucidate the effect of high-temperature storage on the stability of ranitidine, specifically with respect to the potential formation of N -nitrosodimethylamine (NDMA), which is classified as a probable human carcinogen. Commercially available ranitidine reagent powders and formulations were stored under various conditions, and subjected to LC-MS/MS analysis. When ranitidine tablets from two different brands (designated as tablet A and tablet B) were stored under accelerated condition (40 °C with 75% relative humidity), following the drug stability guidelines issued by the International Conference on Harmonisation (ICH-Q1A), for up to 8 weeks, the amount of NDMA in them substantially increased from 0.19 to 116 ppm and from 2.89 to 18 ppm, respectively. The formation of NDMA that exceeded the acceptable daily intake limit (0.32 ppm) at the temperature used under accelerated storage conditions clearly highlights the risk of NDMA formation in ranitidine formulations when extrapolated to storage under ambient conditions. A forced-degradation study under the stress condition (60 °C for 1 week) strongly suggested that environmental factors such as moisture and oxygen are involved in the formation of NDMA in ranitidine formulations. Storage of ranitidine tablets and reagent powders at the high temperatures also increased the amount of nitrite, which is considered one of the factors influencing NDMA formation. These data indicate the necessity of controlling/monitoring stability-related factors, in addition to controlling impurities during the manufacturing process, in order to mitigate nitrosamine-related health risks of certain pharmaceuticals.