Kidney handling of electrolytes varies in different stages of chronic kidney disease (CKD). Diabetes mellitus (DM) plays an important role in CKD. Fractional excretion (FE) is an important means in clinical practice. The relationship between FE of electrolytes in patients at different stages of CKD is worth further investigating.We designed a cross-sectional study in 1 teaching hospital, consecutive CKD patients were enrolled between February 2016 and January 2017. Including clinical demographic features, laboratory examination including spot urine electrolytes, blood biochemistries, and relevant medications were determined.A total of 762 CKD patients completed the study. Of these, 218 (28.6%) had DM. Participants were grouped according to estimated glomerular filtration rate into 7 categories: hyperfiltration (HF), CKD1, CKD2, CKD3a, CKD3b, CKD4, and CKD5. Groups HF, CKD1, 2, 3a, 3b, 4 and 5 contained 83, 143, 192, 94, 82, 82, and 86 patients, respectively. FE of electrolytes tended to increase along with the decline of renal function (CKD1-CKD5) (P < .001). The relationship was similar between the DM and non-DM groups. Diabetic patients demonstrated higher FE of magnesium compared with non-DM subjects at CKD2 and CKD5 (P < .05).CKD patients showed a progressive increase in the FE of electrolytes; FE of magnesium seemed to increase more among diabetic patients with CKD, and could be a potential predictor of CKD progression.