Over the last decades, scanning magnetic microscopy techniques have been increasingly used in paleomagnetism and rock magnetism. Different from standard paleomagnetic magnetometers, scanning magnetic microscopes produce high‐resolution maps of the vertical component of the magnetic induction field (flux density) on a plane located over the sample. These high‐resolution magnetic maps can be used for estimating the magnetization distribution within a rock sample by inversion. Previous studies have estimated the magnetization distribution within rock samples by inverting the magnetic data measured on a single plane above the sample. Here we present a new spatial domain method for inverting the magnetic induction measured on four planes around the sample in order to retrieve its internal magnetization distribution. We have presumed that the internal magnetization distribution of the sample varies along one of its axes. Our method approximates the sample geometry by an interpretation model composed of a one‐dimensional array of juxtaposed rectangular prisms with uniform magnetization. The Cartesian components of the magnetization vector within each rectangular prism are the parameters to be estimated by solving a linear inverse problem. Our method automatically deals with the averaging of the measured magnetic data due to the finite size of the magnetic sensor, preventing the application of a deconvolution before the inversion. Tests with synthetic data show the performance of our method in retrieving complex magnetization distributions even in the presence of magnetization heterogeneities. Moreover, they show the advantage of inverting the magnetic data on four planes around the sample and how this new acquisition scheme improves the estimated magnetization distribution within the rock sample. We have also applied our method to invert experimentally measured magnetic data produced by a highly magnetized synthetic sample that was manufactured in the laboratory. The results show that even in the presence of apparent position noise, our method was able to retrieve the magnetization distribution consistent with the isothermal remanent magnetization induced in the sample.