The present study was conducted to synthesize nitrogen containing derivatives of salicyl alcohol and to investigate in vivo their ulcerogenic potential in comparison with aspirin in rats. The compounds [4-(2-hydroxybenzyl) morpholin-4-iumchloride (I)] and [1,4-bis(2-hydroxybenzyl) piperazine-1,4-diium chloride (II)] were synthesized and their chemical structures were characterized using spectral data. In our previous study (Ali et al., Afr J Pharm Pharmacol 7:585-596, 2013), both compounds showed anti-inflammatory, antinociceptive, and antipyretic properties in standard animal models and a greater binding affinity for cyclooxygenase-2 versus cyclooxygenase-1 in molecular docking and dynamics analysis. For in vivo studies, animals were randomly divided into four groups. The synthetic compounds (both at 100 or 150 mg/kg), aspirin (150 mg/kg), or saline vehicle was administered orally, once daily for 6 days and then tested for ulcerogenic activity. At the end of the procedure, gastric juice and tissues were collected and subjected to biochemical and histological analyses. The results of the study revealed that in the case of the aspirin-treated group, there was a significant increase in gastric juice volume, free acidity, total acidity, and ulcer score and a decrease in gastric pH. Moreover, histological examination of the gastric mucosa of the aspirin-treated group indicated morphological changes while neither of the synthetic compounds showed any significant ulcerogenic or cytotoxic properties. The results of the present study suggest that both compounds are free from ulcerogenic side effects and may represent a better alternative to aspirin.