We present an exact model for determining the cogging torque in a brushless DC (BLDC) motor. It is based on the conformal mapping (CM) method, by which the motor configuration is transformed to a configuration where the magnetic field can be determined. Then, by integrating the field over the stator surface, the cogging torque is determined. By varying some motor parameters, which is easy to do, an optimal configuration with the minimal cogging torque is obtained. We have confirmed the results by the finite-element method (FEM). The model produces results much faster than FEM alone.