An inverse modelling study on the interpretation of magnetic anomalies caused by 2D dyke-shaped bodies was carried out using the differential search algorithm (DSA), a novel metaheuristic inspired by the migration of super-organisms. We aimed at estimating dyke parameters that include amplitude coefficient, depth, half-width, origin and dip angle. First, the resolvability of these parameters and algorithm-dependent parameters of the DSA that affect the performance were determined. Two theoretical and two field anomalies were used in the evaluations. Theoretical anomalies comprise one and two isolated dykes. The effect of noise content was also investigated in these cases. The inversion approach was then applied to two known magnetic field anomalies measured over the Marcona iron mine in Peru and the Pima copper mine in the US state of Arizona. The results showed that the efficiency of the DSA increases significantly with the use of optimal parameter sets of the inverse magnetic problem. Furthermore, cost function maps and relative frequency histograms showed that the parameters half-width and amplitude can be estimated with some uncertainties, while the remaining significant model parameters of the source body can be solved with negligible uncertainties. Findings indicated that the DSA provided satisfactory solutions in accordance with actual data and previously obtained results. Thus, it can be concluded that DSA is an efficient tool for interpreting magnetic anomalies caused by magnetised 2D dykes.