This paper presents a MATLAB based program, including an easy-to-use graphical interface, developed to estimate 3D geometry of magnetic basement interfaces from respective gridded magnetic anomalies by a rapid iterative procedure. The developed code uses an algorithm based on a relationship between the Fourier transforms of the magnetic data and the interface topography. Given the average depth to the magnetic interface and parameters related to the magnetization, the iterative procedure built up in the frequency domain results with accurate depth estimates in a very short computing time. The program is capable of handling large data sets. The convergence in the iterative process is improved by incorporating a high-cut filtering. The iterations stop when either the RMS error between two successive approximations at any step of the iteration has increased relative to the previous step or when the RMS is below a predefined threshold value, or after a specified maximum iterations number. Settings and updating of the input parameters as well as displaying and exporting the interpretation outputs can easily be managed with the interactive control skills supported by the graphical user interface (GUI) of the MagB_inv code. Applicability and efficacy of the algorithm are illustrated on synthetic data from three 3D interface models, the respective inverted depths match the actual depths even in the presence of noise. As a practical example, the algorithm was also applied to observed anomalies of the total magnetic field from NW-Germany. The calculated magnetic basement interface from the real data application is in good agreement with the previously published configurations of the basement of this study area.