Many bacteria form biofilms to protect themselves from predators or stressful environmental conditions. In the biofilm, bacteria are embedded in a protective extracellular matrix composed of polysaccharides, proteins and extracellular DNA (eDNA). eDNA most often is released from lysed bacteria or host mammalian cells, and it is the only matrix component most biofilms appear to have in common. However, little is known about the form DNA takes in the extracellular space, and how different non-canonical DNA structures such as Z-DNA or G-quadruplexes might contribute to its function in the biofilm. The aim of this study was to determine if non-canonical DNA structures form in eDNA-rich staphylococcal biofilms, and if these structures protect the biofilm from degradation by nucleases. We grew Staphylococcus epidermidis biofilms in laboratory media supplemented with hemin and NaCl to stabilize secondary DNA structures and visualized their location by immunolabelling and fluorescence microscopy. We furthermore visualized the macroscopic biofilm structure by optical coherence tomography. We developed assays to quantify degradation of Z-DNA and G-quadruplex DNA oligos by different nucleases, and subsequently investigated how these enzymes affected eDNA in the biofilms. Z-DNA and G-quadruplex DNA were abundant in the biofilm matrix, and were often present in a web-like structures. In vitro, the structures did not form in the absence of NaCl or mechanical shaking during biofilm growth, or in bacterial strains deficient in eDNA or exopolysaccharide production. We thus infer that eDNA and polysaccharides interact, leading to non-canonical DNA structures under mechanical stress when stabilized by salt. We also confirmed that G-quadruplex DNA and Z-DNA was present in biofilms from infected implants in a murine implant-associated osteomyelitis model. Mammalian DNase I lacked activity against Z-DNA and G-quadruplex DNA, while Micrococcal nuclease could degrade G-quadruplex DNA and S1 Aspergillus nuclease could degrade Z-DNA. Micrococcal nuclease, which originates from Staphylococcus aureus, may thus be key for dispersal of biofilm in staphylococci. In addition to its structural role, we show for the first time that the eDNA in biofilms forms a DNAzyme with peroxidase-like activity in the presence of hemin. While peroxidases are part of host defenses against pathogens, we now show that biofilms can possess intrinsic peroxidase activity in the extracellular matrix.