The thermo-reversible capture and release of DNA were studied by the protonation and deprotonation of alkyldimethylamine oxide (CnDMAO, n = 10, 12 and 14) in Tris-HCl buffer solution. DNA/C14DMAO in Tris-HCl buffer solution with pH = 7.2 is transparent at 25 °C, indicating that DNA molecules exist mainly in individuals and the binding of C14DMAO is weak. With the increase of temperature, the pH of the buffer solution continuously decreases, which leads to protonation of C14DMAO (C14DMAO + H(+)→ C14DMAOH(+)) and an obvious increase of the turbidity of the samples. This indicates a stronger binding of the protonated C14DMAOH(+) to DNA. Further investigations demonstrated the formation of DNA/C14DMAOH(+) complexes, in which the stretched DNA molecules are effectively compacted as evidenced from UV-vis absorptions, circular dichroism (CD) measurements, atomic force microscopy (AFM) observations, dynamic light scattering (DLS) measurements and agarose gel electrophoresis (AGE). Interestingly, when the temperature is turned back to 25 °C, the compacted DNA molecules can fully recover to the stretched conformation. This cycle can be repeated several times without obvious loss of efficiency. The effect of the chain length of CnDMAO has also been investigated. When C14DMAO was replaced by C12DMAO, similar phenomena can be observed with a slightly higher critical surfactant concentration for DNA compaction and a slightly lower pH of Tris-HCl buffer solution with pH = 6.8. For the DNA/C10DMAO system, however, no DNA compaction was observed even in Tris-HCl buffer solution with a much lower pH and a much higher C10DMAO concentration. The negative charges of DNA molecules can easily be neutralized by positive charges of cationic CnDMAOH(+) (n = 12 and 14) micelles. DNA was compacted and then insoluble DNA/CnDMAOH(+) complexes were formed. Because of the much higher critical micelle concentration (cmc) of the shorter chain length C10DMAOH(+), cationic C10DMAOH(+) micelles cannot form under the studied condition to compact DNA. The strategy may provide an efficient and alternative approach for stimuli-responsive gene therapy and drug release.