Metaheuristic algorithms are increasingly being utilized as a global optimal method in the inversion and modeling of magnetic data. We proposed the Bat Algorithm Optimization (BAO) technique that is based on bat echolocation performance to find the global optimum solution. The best-estimated source parameters that correspond to the objective function minimum value are obtained after achieving the global optimum (best) solution. The suggested BAO technique does not require any prior knowledge; rather, it is a global search method that provides an effective tool for scanning the space of data to appraise sources parameters. The BAO technique is applied to magnetic data in the class of dipping and vertical dikes along 2D profiles to estimate the dimensional source parameters that include the depth to top, origin location, amplitude coefficient, index angle of magnetization, and width of the dipping dikes. The BAO technique has been used for single and multiple dikes structures. The accuracy and stability of the BAO technique are achieved on different synthetic examples of free and noisy data for single and multiple cases. Furthermore, the presented BAO technique was effectively utilized in three field examples from China and Egypt for iron ore deposits and metavolcanics basalt rock investigations. Overall, the BAO technique recovered inversion outcomes are in good agreement with borehole, geology, and published literature results.