Excalibur is a nonparametric, hierarchical framework for precision wavelength calibration of spectrographs. It is designed with the needs of extreme-precision radial-velocity (EPRV) instruments in mind, which require calibration or stabilization to better than 10^-4^pixels. Instruments vary along only a few dominant degrees of freedom, especially EPRV instruments that feature highly stabilized optical systems and detectors. Excalibur takes advantage of this property by using all calibration data to construct a low-dimensional representation of all accessible calibration states for an instrument. Excalibur also takes advantage of laser-frequency combs or etalons, which generate a dense set of stable calibration points. This density permits the use of a nonparametric wavelength solution that can adapt to any instrument or detector oddities better than parametric models, such as a polynomial. We demonstrate the success of this method with data from the Extreme Precision Spectrograph (EXPRES), which uses a laser-frequency comb. When wavelengths are assigned to laser comb lines using excalibur, the rms of the residuals is about one-fifth that of wavelengths assigned using polynomial fits to individual exposures. Radial-velocity measurements of HD34411 show a reduction in rms scatter over a 10 month time baseline from 1.17 to 1.05m/s.