The potential applications of carbon nanotubes are varied. Although it has long been known that solid carbon can reduce SiO2 to its gaseous state at high temperatures, exploiting this reaction to pattern surfaces with carbon nanotubes has never been demonstrated. Here we show that carbon nanotubes can act as the carbon source to reduce (etch) silicon dioxide surfaces. By introducing small amounts of oxygen gas during the growth of single-walled carbon nanotubes (SWNTs) in the chemical vapour deposition (CVD) process, the nanotubes selectively etch one-dimensional nanotrenches in the SiO2. The shape, length and trajectory of the nanotrenches are fully guided by the SWNTs. These nanotrenches can also serve as a mask in the fabrication of sub-10-nm metal nanowires. Combined with alignment techniques, well-ordered nanotrenches can be made for various high-density electronic components in the nanoelectronics industry.