A new axial method for measuring the friction coefficient with the atomic force microscope is given. This axial method requires no calibration steps and is performed simultaneously with a normal force measurement by measuring the difference between the constant compliance slopes of the extend and retract force curves. The algorithm can be applied retrospectively to extract the friction coefficient from preexisting force measurements. Results are in quantitative agreement with the more established lateral method. The method can be used for both tipped cantilevers and for attached spherical probes.