The chemical reactions and pathways resulting in the formation of ergothioneine, a naturally occurring metabolite of histidine with antioxidant properties.
(2S)-3-(2-mercapto-1H-imidazol-5-yl)-2-(trimethylazaniumyl)propanoate biosynthetic process