Over the past two decades, single-walled carbon nanotubes (SWCNTs) have received much attention because their extraordinary properties are promising for numerous applications. Many of these properties depend sensitively on SWCNT structure, which is characterized by the chiral index (n,m) that denotes the length and orientation of the circumferential vector in the hexagonal carbon lattice. Electronic properties are particularly strongly affected, with subtle structural changes switching tubes from metallic to semiconducting with various bandgaps. Monodisperse 'single-chirality' (that is, with a single (n,m) index) SWCNTs are thus needed to fully exploit their technological potential. Controlled synthesis through catalyst engineering, end-cap engineering or cloning strategies, and also tube sorting based on chromatography, density-gradient centrifugation, electrophoresis and other techniques, have delivered SWCNT samples with narrow distributions of tube diameter and a large fraction of a predetermined tube type. But an effective pathway to truly monodisperse SWCNTs remains elusive. The use of template molecules to unambiguously dictate the diameter and chirality of the resulting nanotube holds great promise in this regard, but has hitherto had only limited practical success. Here we show that this bottom-up strategy can produce targeted nanotubes: we convert molecular precursors into ultrashort singly capped (6,6) 'armchair' nanotube seeds using surface-catalysed cyclodehydrogenation on a platinum (111) surface, and then elongate these during a subsequent growth phase to produce single-chirality and essentially defect-free SWCNTs with lengths up to a few hundred nanometres. We expect that our on-surface synthesis approach will provide a route to nanotube-based materials with highly optimized properties for applications such as light detectors, photovoltaics, field-effect transistors and sensors.