Magnetic field of a solenoid A solenoid is a coil of wire designed to create a strong magnetic field inside the coil. By wrapping the same wire many times around a cylinder, the magnetic field due to the wires can become quite strong. The number of turns N refers to the number of loops the solenoid has. More loops will bring about a stronger magnetic field. Ampere's law can be applied to find the magnetic field inside of a long solenoid as a function of the number of turns per length N/L and the current I. We now look at a cross section of the solenoid. The blue crosses represent the current traveling into the page, while the blue dots represent the currents coming out of the page. Ampere's law (left) for the red path can be written as.        where the number of loops enclose by the path is (N/L)x. Only the upper portion of the path contributed to the sum because the magnetic field is zero outside, and because the vertical paths are perpendicular to the magnetic field. By dividing x out of both sides of the last equation, one finds: This is the result we have been after. The magnetic field inside a solenoid is proportional to both the applied current and the number of turns per unit length. There was no dependence on the diameter of the solenoid or even on the fact that the wires were wrapped around a cylinder and not a rectangular shape. Most importantly, the result did not depend on the precise placement of the path inside the solenoid, indicating that the magnetic field is constant inside the solenoid.