While convolutional neural networks (CNNs) have shown promise for automated choledocholithiasis detection on magnetic resonance cholangiopancreatography (MRCP), transformer-based models have recently emerged as alternatives. However, the relative performance of these approaches for stone classification and localization remains unclear, necessitating systematic comparison. This study therefore compared selected CNN and transformer architectures for MRCP-based choledocholithiasis classification and detection. In this retrospective multicenter study (2022–2025) across two tertiary-care hospitals in Iran, patients with and without common bile duct (CBD) stones were included. Patient-level MRCP scans were partitioned (70:20:10 for training, validation, and internal testing) into cropped and uncropped datasets. CNN (ResNet50, YOLOv12) and transformer-based (Vision Transformer [ViT], RF-DETR) models were evaluated, with an independent dataset from a third institution reserved for external testing. The classification cohort included 1037 patients (523 with CBD stones; mean age 53 ± 14 years), and the detection cohort included 633 patients (523 with CBD stones; mean age 57 ± 16 years). On external cropped images, ResNet50 and ViT achieved accuracies of 96.0% (95% CI 93.5, 98.5) and 97.0% (95% CI 94.0, 99.0), with AUCs of 0.999 and 0.991, respectively; neither the accuracy difference (P = 0.80) nor the AUC difference (DeLong P = 0.16) was statistically significant. On external uncropped images, ViT yielded significantly higher accuracy than ResNet50 (93.5% [95% CI 90.0, 96.5] vs. 87.0% [95% CI 82.5, 91.5]; P = 0.04), whereas the corresponding AUCs (0.979 vs. 0.969) did not differ significantly (DeLong P = 0.39). For object detection, RF-DETR achieved higher mAP@0.5:0.95 than YOLOv12 in both the internal (0.723 [95% CI 0.703, 0.744] vs. 0.687 [95% CI 0.667, 0.709]) and external test datasets (0.668 [95% CI 0.630, 0.707] vs. 0.626 [95% CI 0.588, 0.664]), with statistically significant differences for this metric in each dataset .In conclusion, selected CNN and transformer architectures demonstrated comparable diagnostic performance for MRCP-based choledocholithiasis classification. For object detection, RF-DETR demonstrated higher localization performance than YOLOv12 on the evaluated metrics.