A method to design electromagnetic coils for magnetic particle imaging (MPI) scanners is presented. Three different coils for a rabbit sized scanner are designed, namely, a cylindrical drive coil, a biplanar drive coil, and a quadrupole. Based on the inverse boundary elements method, the optimization of all coils used in an MPI scanner is possible. The inverse problem is solved using the Tikhonov regularization and a quadratic programming with quadratic constraints algorithm. Depending on the chosen objectives, the coils can be designed to precisely generate a given field, having a small inductance, resistance, or having a smooth winding pattern. The properties of a cylindrical drive coil are then validated on a prototype. The use of this technique allows the optimization of the scanner design, to enhance the imaging capacity, and to easily gain control over the key properties of the coils in order to scale up scanners to human size.