You'll find that a current loop is like a magnet. You may have seen current loops of large number of turns in electrical appliances and they are used to produce magnetic fields. A simple electromagnet with coils of wire wound in iron core is shown in figure below. The iron core is not required to produce magnetic field but it increases the magnetic field further.

Here we take a simple circular current loop as shown in Figure 2. The current \(I\) flows into and out of the loop. We determine the magnetic field on its axis at a distance \(x\) from the center of the loop. Here we do similar to what we did to determine the magnetic field of a straight wire, that is apply Biot-Savart law to determine the magnetic field due to small length element \(d\vec l\) and integrate to find the total magnetic field.

The distance between the length element \(dl\) and the field point \(P\) is \(r = \sqrt{x^2 + a^2}\) where \(a\) is the radius of the circular loop. The magnetic field \(d\vec B\) at the fiend point \(P\) has two components; one is the x-component \(d\vec B_x\) and another is the y-component \(d\vec B_y\). You can use the right hand rule of cross product to determine the direction of \(d\vec B\).

The angle between \(d\vec l\) and \(\hat r\) is always \(90^\circ\), so the magnetic field \(dB\) at the field point is

\[ dB = \frac{\mu_0I}{4\pi}\frac{dl}{(x^2 + a^2)}\]

Now magnitudes of the x and y-components of \(d\vec B\) are

\[ dB_x = dB\cos \theta = \frac{\mu_0I}{4\pi}\frac{dl\,a}{(x^2 + a^2)^{3/2}} \]

\[ dB_y = dB \sin \theta = \frac{\mu_0I}{4\pi}\frac{dl\,x}{(x^2 + a^2)^{3/2}} \]

Note that the loop is symmetrical and the y-component of magnetic field due to \(d\vec l\) at one location is exactly opposite in direction to the y-component of magnetic field of \(d\vec l\) at the opposite location of the loop. So, all the y-components cancel each other and the magnetic field at the field point \(P\) is only due to the x-components of \(d\vec B\).

\[B = \frac{\mu_0I}{4\pi} \frac{a}{(x^2 + a^2)^{3/2}} \int dl\]

Note that everything is constant except \(dl\) and the integral of dl is \(2\pi a\) and we get,

\[B = \frac{\mu_0I\,a^2}{2(x^2 + a^2)^{3/2}} \tag{1} \label{1}\]

The above equation gives the magnetic field at the field point \(P\). What if the field point \(P\) is the center of the circle? In that case \(x = 0\) and

\[B = \frac{\mu_0I}{2a} \tag{2} \label{2}\]

We can also determine the magnetic field if the field point \(P\) is very far from the center of the loop, that is \(x >> a\). In that case you can neglect \(a^2\) in \((x^2 + a^2)^{3/2}\) and

\[B \approx \frac{\mu_0I\,a^2}{2x^3} \]

We know that the magnetic moment \(\mu\) is the product of area of the loop and the current \(I\). The area is \(\pi\,a^2\), so \(\mu = \pi\,a^2I\), therefore the above expression can be expressed as

\[B \approx \frac{\mu_0}{2\pi}\frac{\mu}{x^3}\]

The above expression is similar to the electric field due to an electric dipole on its axis we determined in electric field of an electric dipole.

If there are \(N\) loops instead of single loop closely wound, so the distance \(x\) and the radius \(a\) are not affected, we can modify Equation \eqref{1} for the expression of magnetic field for \(N\) loops instead of one and is given by

\[B = \frac{\mu_0NI\,a^2}{2(x^2 + a^2)^{3/2}} \tag{4} \label{4}\]

The above expression in terms of magnetic dipole moment \(\mu\) is

\[B = \frac{\mu_0}{2\pi}\frac{\mu}{(x^2 + a^2)^{3/2}} \tag{5} \label{5}\]

Note that the magnetic dipole moment is introduced in torque on a current loop.

And you can understand that a current loop is a magnetic dipole and has it's own magnetic field similar to that of the permanent magnet (see Figure 3 and Figure 4). The magnetic field can be further increased by using materials such as iron such as in electromagnet shown in Figure 1. Never be confused with the magnetic constant \(\mu_0\) and magnetic dipole moment or magnetic moment \(\mu\) despite they both have \(\mu\).

The convenient way to determine the direction of magnetic field on the axis of a current loop is to apply right hand rule. Curl the fingers in the direction of current keeping thumb straight and the thumb gives the direction of magnetic field on the axis.