Magnesium is the second-most common intracellular cation after calcium with 99% of total body magnesium distributed intracellularly in bones, muscles, and soft tissues. Only 1% of total body magnesium is present extracellularly that contributes to the normal serum magnesium concentration of 1.8–2.6 mg/dL. Recently, many studies have focused on the role of magnesium homeostasis and human health. Diabetes and hypertension are the leading causes of chronic kidney disease (CKD), and the significance of magnesium in CKD has been astonishing in medical practice. In this study, we investigated the serum levels of magnesium and its prevalence at different stages of CKD. This cross-sectional descriptive study was conducted over a period of 2 months. Serum magnesium levels were analyzed in 224 patients with CKD and were grouped into five stages of CKD according to the guidelines of the Kidney Disease: Improving Global Outcomes (KDIGO) based on glomerular filtration rate. Laboratory data of patients was analysed using the IBM SPSS V23 software (Chicago, USA) for statistical relationship between serum magnesium levels and stages of CKD in patients with CKD. Mean serum magnesium level of the study population was 2.21 ± 0.75 mg/dL; 50.9% of the patients were normomagnesemic (normal level of magnesium ions in the blood), followed by 30.4% hypomagnesemic and 20.5%, hypermagnesemic. CKD was more common in males (63.4%), compared to females (36.6%). Mean age of patients in G5 stage was significantly higher than in G3a, G3b, and G4 stages (P = 0.001). A progressive decline in renal function and retention of uraemic solutes was observed with progression of CKD. Multiple factors, both inherited or acquired, such as diuretics and alcohol, are implicated in controlling serum magnesium levels. Magnesium deficiency leads to 2.12-fold higher risk of progression to end-stage renal disease (ESRD).