In the title molecule, C5H7N3OS, all the non-hydrogen atoms except the O atom are almost planar [maximum least squares plane deviation = 0.035 (3) Å for the N atom]. The crystal packing is stabilized by intermolecular O—H⋯N hydrogen bonds, which link the molecules into inversion dimers.