When a current carrying conductor is formed into
a loop or several loops to form a coil, a magnetic field develops
that flows through the center of the loop or coil along its longitudinal
axis and circles back around the outside of the loop or coil.
The magnetic field circling each loop of wire combines with the
fields from the other loops to produce a concentrated field down
the center of the coil. A loosely wound coil is illustrated below
to show the interaction of the magnetic field. The magnetic field
is essentially uniform down the length of the coil when it is
wound tighter.

The strength of a coil's magnetic
field increases not only with increasing current but also with
each loop that is added to the coil. A long, straight coil of wire
is called a solenoid and can be used to generate a nearly uniform
magnetic field similar to that of a bar magnet. The concentrated
magnetic field inside a coil is very useful in magnetizing ferromagnetic
materials for inspection using the magnetic particle testing method.
Please be aware that the field outside the coil is weak and is
not suitable for magnetizing ferromagnetic materials.