Stellar classification based on spectral characteristics plays a pivotal role in astronomy, facilitating the study of celestial bodies’ composition and evolution. In this research, we assess the performance of ten distinct machine learning algorithms in classifying stellar objects using data from the Sloan Digital Sky Survey (SDSS). Leveraging features such as ’u’, ’g’, ’r’, ’i’, ’z’, and ’redshift’, with ’class’ as the target variable, we evaluate the accuracy of algorithms including XGBoost, CNN, RNN, AdaBoost, Adaptive Decision Learner, LSTM Networks, GRU, Random Forest Classifier, SVM, and Logistic Regression. Our findings reveal that the Random Forest Classifier outperforms other algorithms with an accuracy of 97.805%, showcasing its efficacy in capturing the complex spectral patterns of stellar objects. Moreover, other algorithms such as XGBoost, RNN, Adaptive Decision Learner, and GRU demonstrate notable accuracies ranging from 96.609% to 97.395%. This study underscores the utility of machine learning in stellar classification, offering valuable insights for astronomical research and enhancing our comprehension of the cosmos.