Optical-frequency synthesizers, which generate frequency-stable light from a single microwave-frequency reference, are revolutionizing ultrafast science and metrology, but their size, power requirement and cost need to be reduced if they are to be more widely used. Integrated-photonics microchips can be used in high-coherence applications, such as data transmission 1 , highly optimized physical sensors 2 and harnessing quantum states 3 , to lower cost and increase efficiency and portability. Here we describe a method for synthesizing the absolute frequency of a lightwave signal, using integrated photonics to create a phase-coherent microwave-to-optical link. We use a heterogeneously integrated III-V/silicon tunable laser, which is guided by nonlinear frequency combs fabricated on separate silicon chips and pumped by off-chip lasers. The laser frequency output of our optical-frequency synthesizer can be programmed by a microwave clock across 4 terahertz near 1,550 nanometres (the telecommunications C-band) with 1 hertz resolution. Our measurements verify that the output of the synthesizer is exceptionally stable across this region (synthesis error of 7.7 × 10-15 or below). Any application of an optical-frequency source could benefit from the high-precision optical synthesis presented here. Leveraging high-volume semiconductor processing built around advanced materials could allow such low-cost, low-power and compact integrated-photonics devices to be widely used.