We use heterodyne detection to measure optical transmittance over an unprecedented dynamic range, with high accuracy and high sensitivity. Our set-up uses a Mach-Zehnder interferometer with acousto-optic frequency shifting to produce a 30 MHz frequency difference between the two light beams, resulting in a beat envelope on the interferometer output beam. We determine the optical transmittance of a filter by inserting it into one of the interferometer arms and measuring the change in amplitude of the optical beat signal. This method allows direct comparison between optical and RF attenuators, ultimately tying optical transmittance measurements to 30 MHz RF attenuation standards in an absolute way. Using this method, we have measured filters that cover 12 decades of transmittance. We discuss a recently developed instrument that improves the accuracy and dynamic range over which the optical-RF connection can be made. This instrument functions as a lock-in amplifier with a dynamic range of up to 180 dB. In addition, we extend the technique into the infrared at 10,6-mu-m, where we demonstrate that transmittances of filters at room temperature can be measured with a dynamic range of more than 11 decades.