Cations-induced DNA aggregation can modify the local structure of oligonucleotides and has potential applications in medicine and biotechnology. Here, we used atomic force microscopy to investigate λ-DNA aggregation on Mg -treated glass (Mg /glass) and in Mg solution. Atomic force microscopy topography images showed that some DNA fragments were slightly stacked together on 10 mM Mg /glass and stacked stronger on ≥50 mM Mg /glass. They also showed that DNA aggregated stronger in Mg solution than on Mg /glass, ie, DNAs are strongly stacked and twisted at 10 mM Mg , rolled together at 50 mM Mg , and slightly aggregated to form small particles at 100 mM Mg . At a specific condition, ie, heating λ-DNA to 92°C, cooling down to 75°C, adding Mg , and vortexing the resulting solution, DNA strongly aggregated and formed pancake-like shapes at 10 and 50 mM or a large aggregate at 100 mM Mg solutions. Our results may be helpful for medical applications and gene therapy using cation-DNA technology.