In accelerators, the electron beam longitudinal dynamics critically depend on the energy distribution of the beam. Noninvasive, highly accurate measurement of the energy spread of the electron beam in the storage ring remains a challenge. Conventional techniques are limited to measuring a relatively large energy spread using the energy spread induced broadening effect of radiation source size or radiation spectrum. In this work, we report a versatile method to accurately measure the electron beam relative energy spread from 10 À4 to 10 À2 using the optical klystron radiation. A novel numerical method based on the Gauss-Hermite expansion has been developed to treat both spectral broadening and modulation on an equal footing. A large dynamic range of the measurement is realized by properly configuring the optical klystron. In addition, a model-based scheme has been developed for the first time to compensate the beamemittance-induced inhomogeneous spectral broadening effect to improve the accuracy of the energy spread measurement. Using this technique, we have successfully measured the relative energy spread of the electron beam in the Duke storage ring from 6 Â 10 À4 to 6 Â 10 À3 with an overall uncertainty of less than 5%. The optical klystron is a powerful diagnostic for highly accurate energy spread measurement for storage rings and other advanced electron accelerators.