The increasing use of social media platforms has led to an exponential rise in data related to individuals’ mental health, providing valuable insights for the detection of mental disorders. This project explores the use of Machine Learning (ML) techniques, particularly Random Forest and Decision Tree algorithms, to detect potential mental health issues from social media data. By analyzing the textual content shared by users, the system aims to predict whether a person might be experiencing a mental health disorder based on their posts and interactions. In this study, we preprocess the textual data using Natural Language Processing (NLP) techniques, such as tokenization, stopword removal, and vectorization through the Term Frequency-Inverse Document Frequency (TF-IDF) method. The preprocessed data is then used to train two widely-used classification models: Random Forest and Decision Tree. The Random Forest algorithm, an ensemble learning method, leverages multiple decision trees to improve the accuracy and robustness of predictions, while the Decision Tree algorithm builds a tree-like model to make predictions based on feature values. The trained models are evaluated for their classification accuracy, with the Random Forest model expected to provide better generalization by reducing overfitting compared to the Decision Tree model. Both models are tested on social media data, with the goal of determining whether a user’s posts indicate the potential for mental health disorders such as anxiety, depression, or stress. The results of this study aim to contribute to the development of automated tools for early mental health detection, which can help in timely intervention and support. In conclusion, the use of machine learning algorithms such as Random Forest and Decision Tree offers a promising approach for detecting mental health disorders from social media data, showcasing the potential of AI in the healthcare domain. This can aid mental health professionals and organizations in providing early assistance to individuals in need.