This study aimed to improve microbial flocculant production by optimizing the components of a Bacillus subtilis CZ1003 culture medium. Using the flocculation rate as the dependent variable, single-factor experiments were performed and beef extract at a concentration of 9 g/L was found to be the optimal nitrogen source, while glucose at a concentration of 20 g/L was the optimal carbon source. KCl, MgCl 2 , NaCl, and CaCl 2 at concentrations of 0.75, 2.5, 0.5, and 5.0 g/L, respectively, were the optimum inorganic salts, in order of flocculant production activity. Orthogonal experimental demonstrated that KCl played a dominant role for Bacillus subtilis production of bioflocculants, followed by NaCl and CaCl 2 . Optimization experiments demonstrated that the optimal combination of the two salts was 0.75 g/L KCl and 0.5 g/L NaCl, resulting in a flocculation rate of 36.2% when included together at these concentrations. The final optimized medium consisted of 20 g/L glucose, 9 g/L beef extract, 0.75 g/L KCl, and 0.5 g/L NaCl. Compared with the initial medium, the optimized medium enhanced the flocculation activity from 12.1 to 36.2%, which equates to an increase of 199.17%. Meanwhile, the flocculant yield was increased from 0.058 g/L to 0.134/L, an increase of 131.03%. The optimized medium could be used to improve microbial flocculant production and provides a basis for further exploration.