Method to calculate the magnetic field produced by finite size helical coils with an rectangular cross section is derived. The uniform current density across the cross section is assumed. The double integral across the cross section is carried out analytically, and the integral along the axis of the helical coils is carried out numerically. An example of the helical coil wound around a toroid is shown, under the assumption that the edge of the coil is tangential to the toroid.