Safety issues caused by pharmaceuticals have frequently occurred worldwide, posing a tremendous threat to human health. As an essential part of drug development, the toxicological analysis and safety evaluation is of great significance. In addition, the risk of pharmaceuticals accumulation in the environment and the monitoring of the toxicity from natural medicines have also received ongoing concerns. Due to a lack of spatial distribution information provided by common analytical methods, analyses that provide spatial dimensions could serve as complementary safety evaluation methods for better prediction and evaluation of drug toxicity. With advances in technical solutions and software algorithms, mass spectrometry imaging (MSI) has received increasing attention as a popular analytical tool that enables the simultaneous implementation of qualitative, quantitative, and localization without complex sample pretreatment and labeling steps. In recent years, MSI has become more attractive, powerful, and sensitive and has been applied in several scientific fields that can meet the safety assessment requirements. This review aims to cover a detailed summary of the various MSI technologies utilized in the biomedical and pharmaceutical area, including technical principles, advantages, current status, and future trends. Representative applications and developments in the safety‐related issues of different pharmaceuticals and natural medicines are also described to provide a reference for pharmaceutical research, improve rational clinical medicine use, and ensure public safety.