The rapid growth of social media platforms has significantly increased online communication. However, this growth has also led to the spread of hate speech, offensive language, and abusive content. Automatic hate speech detection is essential to maintain a safe and respectful online environment. This paper proposes a hybrid approach for detecting hate speech using traditional machine learning and deep learning models. A synthetic dataset was generated containing labeled examples of hate and non-hate speech. The dataset was processed using TF-IDF feature extraction and classified using Logistic Regression. Additionally, a deep learning model based on Bidirectional Encoder Representations from Transformers (BERT) was implemented to improve classification performance. Experimental results demonstrate that the BERT model significantly outperforms traditional machine learning methods in detecting contextual hate speech. The proposed system provides an effective approach for automated moderation of online content.