A spatially uniform magnetic energy density gradient (∇B2) distribution offers a controlled environment to separate magnetically tagged cells or biomolecules based on their magnetophoretic mobility [L. R. Moore etal, J. Biochem. Biophys. Methods 37, 11 (1998)]. A design to obtain a uniform ∇B2 distribution for a microelectromechanical-systems-based magnetic cell separator was developed. The design consists of an external magnetic circuit and a microfabricated channel (biochip) with embedded discrete pole pieces on the channel walls. The two-dimensional and three-dimensional magnetostatic simulation softwares utilizing boundary element methods were used to optimize the positions and the dimensions of the discrete pole pieces, as well as the external magnetic circuit—the combination of which would generate a uniform ∇B2 profile over the channel cross section. It was found that the discrete pole pieces required specific magnetic properties (saturation magnetization constant ≫1.55 T) to affect the overall ∇B2 distribution. Investigating different positions of the discrete pole pieces inside the external magnetic field indicated that the proposed design could generate uniform ∇B2 distribution with ±100 μm displacements along the height/width and ±1° inclination from the optimum position.