Efficient and precise control of the frequency of light on gigahertz scales is important for a wide range of applications. Examples include frequency shifting for atomic physics experiments [1, 2], single-sideband modulation for microwave photonics applications [3][4][5][6], channel switching and swapping in optical communication systems [7,8], and frequency shifting and beam splitting for frequency domain photonic quantum computing [9][10][11][12][13]. However, realizing GHz-scale frequency shifts with high efficiency, low loss and reconfigurability, in particular using a miniature and scalable device, is challenging since it requires efficient and controllable nonlinear optical processes. Existing approaches based on acousto-optics [6, 14-16], all-optical wave mixing [10,13,[17][18][19], and electrooptics [20][21][22][23] are either limited to low efficiencies or frequencies, or are bulky, and have yet to simultaneously demonstrate the required properties mentioned above. Here we demonstrate an onchip electro-optic frequency shifter that is precisely controlled using only a single-tone microwave signal. This is accomplished by engineering the density of states of, and coupling between, optical modes in ultra-low loss electro-optic waveguides and resonators realized in lithium niobate nanophotonics [24]. Our device provides frequency shifts as high as 28 GHz with measured shift efficiencies of ∼99% and insertion loss of <0.5 dB. Importantly, the device can be reconfigured as a tunable frequency-domain beam splitter, in which the splitting ratio and splitting frequency are controlled by microwave power and frequency, respectively. Using the device, we also demonstrate (non-blocking) frequency routing through an efficient exchange of information between two distinct frequency channels, i.e. swap operation. Finally, we show that our scheme can be scaled to achieve cascaded frequency shifts beyond 100 GHz. Our device could become an essential building-block for future high-speed and large-scale classical information processors [7,25] as well as emerging frequency-domain photonic quantum computers [9,11].