Safflower has both medicinal and edible values but research on its nutrient composition is still lacking. This study was established for the quantitative determination of 28 nucleosides, nucleobases, and amino acids based on the ultra‐performance liquid chromatography coupled with triple‐quadrupole linear ion‐trap tandem mass spectrometry. Analysis of 30 batches of safflower from different producing areas indicated that the contents of l‐proline, l‐asparagine, l(+)‐arginine, l‐serine, l‐histidine, uracil, guanosine, and uridine was high in safflower. Principle component analysis and cluster analysis found that samples from different regions could be distinguished well, and samples from the same area could be clustered into one class, different geographical environments may cause the differences of nucleosides, nucleobases, and amino acids in safflower. The analysis of principal component analysis, cluster analysis, and counter propagation artificial neural network show similar results. Then the content of nucleosides, nucleobases, and essential amino acids were compared, and found that the content in safflower from Gansu was higher than those from other regions, and there was a little difference between the samples from Xinjiang, Sichuan, and Yunnan. This research revealed the composition of nucleosides, nucleobases, and amino acids in safflower, and provided a theoretical basis for utilization of safflower.