Traceability of measurements and calibration of devices are needed also at the nanometre scale. Calibration of a commercial atomic force microscope (AFM) was studied as part of a dimensional nanometrology project at MIKES. The calibration procedure and results are presented here. The metrological properties of the AFM were characterized by several measurements. A method developed to calibrate the z scale by a laser interferometer during a normal measurement mode of an AFM is presented. x and y movements were studied with a laser interferometer and the scales were also calibrated using a calibration grid, which was calibrated at MIKES using a laser diffraction method. The advantages and disadvantages of the two methods are discussed. Orthogonalities of the axes were determined by calibration grids and an error separation method. Out-of-plane deviation was measured with a flatness standard. Uncertainty estimates for the coordinate system of the AFM scanner are presented.