Sodium–glucose transporter (SGLT)2 inhibitors increase plasma magnesium and plasma phosphate and may cause ketoacidosis, but the contribution of improved glycemic control to these observations as well as effects on other electrolytes and acid–base parameters remain unknown. Therefore, our objective was to compare the effects of SGLT2 inhibitors dapagliflozin and sulfonylurea gliclazide on plasma electrolytes, urinary electrolyte excretion, and acid–base balance in people with Type 2 diabetes (T2D). We assessed the effects of dapagliflozin and gliclazide treatment on plasma electrolytes and bicarbonate, 24-hour urinary pH and excretions of electrolytes, ammonium, citrate, and sulfate in 44 metformin-treated people with T2D and preserved kidney function. Compared with gliclazide, dapagliflozin increased plasma chloride by 1.4 mmol/l (95% CI 0.4–2.4), plasma magnesium by 0.03 mmol/l (95% CI 0.01–0.06), and plasma sulfate by 0.02 mmol/l (95% CI 0.01–0.04). Compared with baseline, dapagliflozin also significantly increased plasma phosphate, but the same trend was observed with gliclazide. From baseline to week 12, dapagliflozin increased the urinary excretion of citrate by 0.93 ± 1.72 mmol/day, acetoacetate by 48 μmol/day (IQR 17–138), and β-hydroxybutyrate by 59 μmol/day (IQR 0–336), without disturbing acid–base balance. In conclusion, dapagliflozin increases plasma magnesium, chloride, and sulfate compared with gliclazide, while reaching similar glucose-lowering in people with T2D. Dapagliflozin also increases urinary ketone excretion without changing acid–base balance. Therefore, the increase in urinary citrate excretion by dapagliflozin may reflect an effect on cellular metabolism including the tricarboxylic acid cycle. This potentially contributes to kidney protection.