This study applies the cuckoo optimization algorithm (COA), inspired by the brood reproduction technique of cuckoo birds, to interpret magnetic anomalies of 2D dipping dyke-like structures. The primary issue addressed is the need for accurate delineation and explanation of dyke parameters, which are crucial for visualizing dyke propagation (important for volcanic hazard assessment), tracing mineralized zones associated with dykes, and understanding their geodynamic significance. Our method identifies dyke parameters at the minimum value of the suggested objective function, ensuring the best fit. The proposed COA method was tested on both noise-free numerical magnetic datasets and datasets with varying levels of random noise (5%, 10%, and 20%), as well as real-case datasets from China and the UK. A comparative analysis with particle swarm optimization (PSO) and genetic algorithm (GA) methods was conducted to evaluate the efficiency and consistency of COA. The results demonstrate that COA aligns well with existing geological and geophysical information, offering superior accuracy and robustness compared to traditional techniques. This study provides a novel and effective approach for subsurface characterization, advancing the precision of geological and geophysical interpretations.