Background and Aim Breast cancer is the abnormal cell growth in the breast. In both benign and malignant masses, there is rapid and high cell growth. Nowadays, due to the development of technologies, the diagnosis of diseases has become non-invasive and physicians attempts to diagnose the disease without surgery and based on internal organ images.Methods & Materials In this study, by using images prepared from the Digital Database for Screening Mammography (DDSM), a new method is proposed for detecting cancerous masses in the mammographic images using geometric features extraction and optimization of Support Vector Machine (SVM) parameters to classify breast cancer masses automatically. First, images were pre-processed and then boundaries were determined using threshold method. Next, morphological operators were used to improve these boundaries and the segmentation of images was carried out to classify cancerous masses. Finally, by using the SVM parameter optimization method, Grasshopper Optimization Algorithm (GOA), and 4-fold crossvalidation method, data were classified into two groups of benign and malignant (cancer) masses. Ethical Considerations Images from DDSM database were used in this research, all images are open access in this database. Results The accuracy, sensitivity and specificity values for applying the Radial Basis Function (RBF) kernel in SVM classifier (before optimization process) were obtained 97%, 100% and 96, respectively. After optimization of SVM parameters by the GOA, it was reported 100% for all accuracy, sensitivity and specificity indices for applying linear kernel function, indicating the high accuracy of the proposed method. The average values of accuracy, sensitivity and specificity indices for applying all three SVM kernel functions after optimization were 95.83, 100 and 94.81%, respectively. Conclusion The extracted geometrical features from breast cancer masses are highly efficient for model training and the diagnosis of breast cancer. The GOA could improve the overall accuracy of the proposed method by optimizing the SVM parameters. The results showed the higher performance of the proposed method compared to other methods.