Machine learning (ML) and deep learning (DL) have significantly advanced, enabling transformative applications in natural language processing, computer vision, and speech recognition. This progress demands accurate and efficient modeling, particularly for large datasets. In credit card fraud detection, diverse DL and ML approaches have been employed to enhance performance and reliability. This study utilized the Creditcard.csv dataset, consisting of 284807 European transactions with 30 PCA-transformed features and a ‘Class’ variable for legitimacy or fraud. The dataset was preprocessed and evaluated under both imbalanced and balanced conditions. Ten models, including Logistic Regression (LR), Naive Bayes (NB), K-Nearest Neighbors (KNN), Decision Trees (DT), Random Forest (RF), Support Vector Machine (SVM), XGBoost, Gradient Boosting (GB), LightGBM (LGBM), and Autoencoders (AE), were assessed using precision, recall, F1 score, and AUC. All experiments were conducted in Python. The findings demonstrate the strong fraud detection capabilities of LGBM (RandomOverSampler), RF, and KNN, while XGBoost (RandomOverSampler) achieved nearly perfect AUC. Ensemble learning methods such as RF, XGBoost, and LGBM demonstrated superior generalization and robustness. These methods consistently achieved accuracy scores above 0.99 and AUC values above 0.96, highlighting their effectiveness in addressing class imbalance and identifying complex fraud patterns.