A single loop of wire can be used to create a magnetic field by passing an electric current through the wire. The direction of the field is found by using the "right hand rule". Align the fingers of the right hand along the wire in such a way that they point in the direction of the current. The extended thumb of the right hand will then show the direction of the magnetic field as it passes through the center of the loop. The magnetic field is continuous, so as it leaves the coil it will be bent around and re-enter the coil at the opposite side.
When a wire is wrapped into a series of tightly packed, single layer of circular loops it is known as a "solenoid". When current is passed through the solenoid a magnetic field is created by each of the loops which add together as vectors to create a single magnetic field. The strength of the field that is created is proportional to the number of loops of wire and the strength of the current which passes through the wire.
The formula that describes the relationship between the magnetic field strength, B, and the number of loops of the the coil and the current strength is:
B = uNI
In this equation
B is the magnetic field strength
u is the permeability of free space
N is the number of circular loops in the solenoid
I is the strength of the current.
From this relationship we can see that the size of the magnetic field will increase as the number of loops increases.
We can also see that the size of the magnetic field will increase as the size of the electric current (I) increases.