An enzyme that degrades nucleic acids. A nuclease can be DNA-specific (a DNase), RNA-specific (RNase), or non-specific. It may act only on single stranded nucleic acids, or only on double-stranded nucleic acids, or it may be non-specific with respect to strandedness. A nuclease may degrade only from an end (an exonuclease), or may be able to start in the middle of a strand (an endonuclease). To further complicate matters, many enzymes have multiple functions; for example, Bal31 has a 3′-exonuclease activity on double-stranded DNA, and an endonuclease activity specific for single-stranded DNA or RNA.