Nanoscale electronic devices made of carbon nanotubes (e.g. transistors, sensors) can be much smaller and more versatile than any conventional microelectronic chips, while the lack of a mass-production method has been holding back their practical applications. Inspired by biomolecular self-assembly, we developed a novel self-assembly method for the wafer-scale fabrication of millions of carbon nanotube circuits with a single-nanotube-level precision. This method may enable industrial-level production of nanotube-based devices such as faster electronic circuits and high-density sensor arrays.