The kidney has a vital role in magnesium homeostasis and, although the renal handling of magnesium is highly adaptable, this ability deteriorates when renal function declines significantly. In moderate chronic kidney disease (CKD), increases in the fractional excretion of magnesium largely compensate for the loss of glomerular filtration rate to maintain normal serum magnesium levels. However, in more advanced CKD (as creatinine clearance falls <30 mL/min), this compensatory mechanism becomes inadequate such that overt hypermagnesaemia develops frequently in patients with creatinine clearances <10 mL/min. Dietary calcium and magnesium may affect the intestinal uptake of each other, though results are conflicting, and likewise the role of vitamin D on intestinal magnesium absorption is somewhat uncertain. In patients undergoing dialysis, the effect of various magnesium and calcium dialysate concentrations has been investigated in haemodialysis (HD) and peritoneal dialysis (PD). Results generally show that dialysate magnesium, at 0.75 mmol/L, is likely to cause mild hypermagnesaemia, results for a magnesium dialysate concentration of 0.5 mmol/L were less consistent, whereas serum magnesium levels were mostly normal to hypomagnesaemic when 0.2 and 0.25 mmol/L were used. While dialysate magnesium concentration is a major determinant of HD or PD patients’ magnesium balance, other factors such as nutrition and medications (e.g. laxatives or antacids) also play an important role. Also examined in this review is the role of magnesium on parathyroid hormone (PTH) levels in dialysis patients. Although various studies have shown that patients with higher serum magnesium tend to have lower PTH levels, many of these suffer from methodological limitations. Finally, we examine the complex and often conflicting results concerning the interplay between magnesium and bone in uraemic patients. Although the exact role of magnesium in bone metabolism is unclear, it may have both positive and negative effects, and it is uncertain what the optimal magnesium levels are in uraemic patients.