The rapid growth of digital transactions has increased the risk of anomalous activities such as fraud, particularly in highly imbalanced datasets where fraudulent transactions are significantly fewer than normal transactions. This imbalance presents a major challenge in anomaly detection, as models tend to be biased toward the majority class. This study aims to compare the performance of Isolation Forest and Local Outlier Factor (LOF) algorithms in detecting anomalies in digital transaction data.The research adopts an experimental approach using the Credit Card Fraud Detection dataset, which consists of 284,807 transactions, including 492 fraudulent cases. Data preprocessing involves feature normalization using StandardScaler, followed by a stratified train-test split with a ratio of 70:30. Model evaluation is conducted using confusion matrix, precision, recall, and F1-score metrics.The results show that Isolation Forest outperforms LOF. Isolation Forest successfully detects 37 out of 148 fraudulent transactions with a precision of 0.2824, recall of 0.25, and F1-score of 0.2652. In contrast, LOF detects only 2 fraudulent transactions, with a precision of 0.0137, recall of 0.0135, and F1-score of 0.0136. These findings indicate that isolation-based approaches are more effective and robust than density-based methods in handling highly imbalanced datasets.