Handheld frequency-domain electromagnetic (EM) instruments are being used increasingly for shallow environmental and geotechnical surveys because of their portability and speed of use in field operations. However, in many cases, the quality of data is so poor that quantitative interpretation is not justified. This is because the small-loop EM method is required to detect very weak signals (the secondary magnetic fields) in the presence of the dominant primary field, so the data are inherently susceptible to calibration errors. Although these errors can be measured by raising the instrument high above the ground so that the effect of the conducting ground is negligible, it is impracticable to do so for every survey. We have developed an algorithm that simultaneously inverts small-loop EM data for a multidimensional resistivity distribution and offset errors. For this inversion method to work successfully the data must be collected at two heights. The forward modeling used in the inversion is based on a staggered-grid 3D finite-difference method; its solution has been checked against a 2.5D finite-element solution. Synthetic and real data examples demonstrate that the inversion recovers reliable resistivity models from multifrequency data that are contaminated severely by offset errors.