A class of enzymes that degrades DNA and/or RNA molecules by cleaving the phosphodiester bonds that link adjacent nucleotides. In deoxyribonuclease (DNase), the substrate is DNA. In endonuclease, it cleaves at internal sites in the substrate molecule. Exonuclease progressively cleaves from the end of the substrate molecule. In ribonuclease (RNase), the substrate is RNA. In the S1 nuclease, the substrate is single-stranded DNA or RNA.