This study presents a comparative analysis of three nature-inspired algorithms-Black Hole Algorithm (BHA), Earthworm Optimization Algorithm (EWA), and Future Search Algorithm (FSA)-for predicting the compressive strength of masonry structures. Each algorithm was integrated with a Multilayer Perceptron (MLP) model, using a structural dimension, rebound number, ultrasonic pulse velocity, and failure load dataset. The dataset was divided into training (70%) and testing (30%) subsets to evaluate model performance. Root Mean Square Error (RMSE) and the coefficient of determination (R2) were employed as statistical indices to measure accuracy. The BHA-MLP model achieved the best performance, with an RMSE of 0.04731 and an R2 of 0.9995 for the training dataset and an RMSE of 0.06537 and an R2 of 0.99877 for the testing dataset, securing the highest overall score. FSA-MLP ranked second, demonstrating strong predictive performance, followed by EWA-MLP, which performed with lower accuracy but still showed valuable results. The study highlights the potential of using these nature-inspired optimization algorithms to enhance the predictive accuracy of compressive strength in masonry structures, offering insights for engineering and policymaking to improve structural safety and performance.