Nanoelectromechanical systems (NEMS) hold promise for a number of scientific and technological applications. In particular, NEMS oscillators have been proposed for use in ultrasensitive mass detection1,2, radio-frequency signal processing3,4, and as a model system for exploring quantum phenomena in macroscopic systems5,6. Perhaps the ultimate material for these applications is a carbon nanotube. They are the stiffest material known, have low density, ultrasmall cross-sections and can be defect-free. Equally important, a nanotube can act as a transistor7 and thus may be able to sense its own motion. In spite of this great promise, a room-temperature, self-detecting nanotube oscillator has not been realized, although some progress has been made8,9,10,11,12. Here we report the electrical actuation and detection of the guitar-string-like oscillation modes of doubly clamped nanotube oscillators. We show that the resonance frequency can be widely tuned and that the devices can be used to transduce very small forces.