The optimization of blasting operations greatly benefits from the prediction of rock fragmentation. The main factors that affect fragmentation are rock mass characteristics, blast geometry, and explosive properties. This paper is a step towards the implementation of machine learning and deep learning algorithms for predicting the extent of fragmentation (in percentage) in open pit mining. While various parameters can affect rock fragmentation, this study considers ten among them (i.e., spacing, drill hole diameter, burden, average bench height, powder factor, number of holes, charge per delay, uniaxial compressive strength, specific drilling, and stemming) to train and test the models. However, due to a weak correlation with rock fragmentation, drill diameter, average bench height, compressive strength, stemming, and charge per delay are eliminated to reduce model complexity. A total of 219 data sets having five input features including the number of holes, spacing, burden, specific drilling, and powder factor are used to develop the models. Machine learning models (random forest regression, support vector regression, and XG boost), as well as a deep learning model (neural network regression), are applied to develop a practical way that can optimize the prediction of fragmentation. This study employs performance measures such as R-squared, RMSE, MSE, MAPE, and MAE. The optimization of the model revealed promising results, indicating that the architecture 5-64-32-16-1 exhibits strong performance. Specifically, the model achieved mean squared error (MSE) values of 41.32 and 28.59 on the training and test datasets, respectively. The R2 value for both training and test is 0.83. RFR is also performing well compared to SVR and XG boost with MSE values of 12.37 and 9.89 on training and testing data, respectively.in both sets, the R2 value is 94%. Based on permutation importance and shapely plot values, it is observed that the powder factor has the highest impact, while the burden has the lowest impact on fragmentation.