Magnetic fields play a fundamental role in star formation processes and the best method to evaluate their intensity is is to measure the Zeeman effect of atomic and molecular lines. However, a direct measurement of the Zeeman spectral pattern from interstellar molecular species is challenging due to the high sensitivity and high spectral resolution required. So far, the Zeeman effect has been detected unambiguously in star forming regions for very few non-masing species, such as OH and CN. We decided to investigate the ability of sulfur monoxide (SO), which is one of the most abundant species in star forming regions, for probing the intensity of magnetic fields via Zeeman effect. The Zeeman effect for several rotational transitions of SO in the (sub-)mm spectral regions has been investigated by using a frequency-modulated, computer-controlled spectrometer, and by applying a magnetic field parallel to the radiation source. To support the experimental determination of the g factors of SO, a systematic quantum-chemical investigation of these parameters for both SO and O_2 has been carried out. An effective experimental-computational strategy for providing accurate g factors as well as for identifying the rotational transitions showing the strongest Zeeman effect has been presented. Our investigation supports SO as a good candidate for probing magnetic fields in high-density star forming regions.