Broadband terahertz spectroscopy enables many promising applications in science and industry alike. However, the complexity of existing terahertz systems has as yet prevented the breakthrough of this technology. In particular, established terahertz time-domain spectroscopy (TDS) schemes rely on complex femtosecond lasers and optical delay lines. Here, we present a method for optoelectronic, frequency-modulated continuous-wave (FMCW) terahertz sensing, which is a powerful tool for broadband spectroscopy and industrial non-destructive testing. In our method, a frequency-swept optical beat signal generates the terahertz field, which is then coherently detected by photomixing, employing a time-delayed copy of the same beat signal. Consequently, the receiver current is inherently phase-modulated without additional modulator. Owing to this technique, our broadband terahertz spectrometer performs (200 Hz measurement rate, or 4 THz bandwidth and 117 dB peak dynamic range with averaging) comparably to state-of-the-art terahertz-TDS systems, yet with significantly reduced complexity. Thickness measurements of multilayer dielectric samples with layer-thicknesses down to 23 µm show its potential for real-world applications. Within only 0.2 s measurement time, an uncertainty of less than 2 % is achieved, the highest accuracy reported with continuous-wave terahertz spectroscopy. Hence, the optoelectronic FMCW approach paves the way towards broadband and compact terahertz spectrometers that combine fiber optics and photonic integration technologies.