This study investigated the changes in ventricular repolarization parameters assessed by electrocardiography (#ECG ) in the presence of hypomagnesemia and the relationship between these parameters and serum #magnesium levels. A total of 160 individuals were included in this retrospective, observational study, who were divided into two groups according to serum magnesium levels: hypomagnesemia group (n = 80; serum Mg < 1.7 mg/dL) and normomagnesemia control group (n = 80; serum Mg 1.8-2.2 mg/dL). The two groups were matched for age and gender. Ventricular repolarization parameters such as QT, corrected #QT (QTc), T peak-to-T end interval (Tp-e), Tp-e/QT, Tp-e/QTc, QRS duration, and heart rate were measured from the ECG recordings of all participants and compared. In the hypomagnesemia group, QT, QTc, Tp-e, Tp-e/QT, and Tp-e/QTc parameters were significantly prolonged compared to the control group (for all p < 0.001). A significant negative correlation was found between serum magnesium level and QTc (r = – 0.437), Tp-e (r = – 0.457), Tp-e/QT (r = – 0.288), and Tp-e/QTc (r = – 0.281). In multivariate regression analyses, magnesium level was determined as an independent predictor for both QTc duration (β = – 20.3, p < 0.001) and Tp-e/QTc ratio (β = – 0.048, p = 0.001), despite controlling for potential confounding variables. The findings show that serum magnesium level is independent and clinically significant on ventricular repolarization duration and heterogeneity. Hypomagnesemia was associated with alterations in ventricular repolarization parameters, reflecting increased repolarization heterogeneity. Our findings suggest that low serum magnesium is independently associated with prolonged Tp-e/QTc and QTc intervals, highlighting its role in ventricular repolarization heterogeneity.