Contrary to the understanding that divalent cations only result in under-estimation of gene quantification via DNA hybridization-based assays, we have discovered that Mg 2+ could cause either under or over-estimation at different concentrations. Its switchable inhibitory behavior is likely due to its rigid first solvation (hydrated) shell and hence it is inclined to form non-direct binding with DNA. At low concentrations, it caused under-estimation by occupying the hybridization sites. At high concentrations, it caused probe, signaling and target DNA to aggregate non-specifically via Coulomb forces. By quantifying target DNAs at a range of Mg 2+ concentrations using a gene quantification assay (NanoGene assay), a Mg 2+ inflection concentration of ∼10 −3 M was observed for both target ssDNA and dsDNA. Field emission scanning electron microscopy (FE-SEM), energy dispersive X-ray spectroscopy (EDS), and Fourier transform infrared spectroscopy (FT-IR) were employed to observe Mg 2+ -induced non-specific binding in the complexes that mimicked the presence of target DNA. Together with two other divalent cations Ca 2+ and Cu 2+ , they were further examined via zeta potential measurements as well as NanoGene assay. This study revealed the importance of Mg 2+ in achieving accurate gene quantification. Through a better mechanistic understanding of this phenomenon, it will be possible to develop strategies to mitigate the impact of Mg 2+ on DNA hybridization-based gene quantification.