Full-waveform inversion (FWI) of Rayleigh waves is attractive for shallow geotechnical investigations due to the high sensitivity of Rayleigh waves to the S-wave velocity structure of the subsurface. In shallow-seismic field data, the effects of anelastic damping are significant. Dissipation results in a low-pass effect as well as frequency-dependent decay with offset. We found this by comparing recorded waveforms with elastic and viscoelastic wave simulation. The effects of anelastic damping must be considered in FWI of shallow-seismic Rayleigh waves. FWI using elastic simulation of wave propagation failed in synthetic inversion tests in which we tried to reconstruct the S-wave velocity in a viscoelastic model. To overcome this, -values can be estimated from the recordings to quantify viscoelasticity. Waveform simulation in the FWI then uses these a priori values when inferring seismic velocities and density. A source-wavelet correction, which is inevitable in FWI of field data, can compensate a significant fraction of the residuals between elastically and viscoelastically simulated data by narrowing the signals’ bandwidth. This way, elastic simulation becomes applicable in FWI of data from anelastic media. This approach, however, was not able to produce a frequency-dependent amplitude decay with offset. Reconstruction, therefore, was more accurate when using appropriate viscoelastic modeling in FWI of shallow-seismic Rayleigh waves. We found this by synthetic inversion tests using elastic forward simulation as well as viscoelastic simulation with different a priori values for .