A current-carrying conductor produces a magnetic field around it. The shape and strength of the magnetic field depend on the shape of the conductor, such as a circular loop or a solenoid.
Magnetic field due to a current through a circular loop:
When a straight current-carrying conductor is bent into the shape of a circular loop, it produces a magnetic field around it. Every point on the loop generates magnetic field lines in the form of concentric circles. As the distance from the wire increases, these circles become larger. At the centre of the loop, the curved field lines appear almost as straight, parallel lines.

Magnetic field lines of the field produced by a current-carrying circular loop
According to the right-hand thumb rule, the magnetic field produced by each section of the circular loop is in the same direction at the centre. Therefore, the magnetic fields due to all sections combine, producing a strong magnetic field at the centre of the loop.
The magnetic field strength depends directly on the current flowing through the loop. If the loop consists of \(n\) turns, the magnetic field becomes \(n\) times stronger than that produced by a single turn because the magnetic fields produced by each turn add together.

Pattern of the magnetic field produced by a current-carrying circular coil
Factors affecting the magnetic field of a circular loop:
1. Current through the loop
The magnetic field strength increases with an increase in current.
Greater current produces a stronger magnetic field.
2. Number of turns of the coil
A coil with more turns produces a stronger magnetic field.
The magnetic field is directly proportional to the number of turns.
3. Direction of current
The direction of the magnetic field depends on the direction of current.
It is determined using the right-hand thumb rule.
4. Distance from the wire
The magnetic field decreases as the distance from the current-carrying wire increases.
The field is strongest at the centre of the circular loop.
Magnetic field due to a current in a solenoid:
A solenoid is a long cylindrical coil made by winding many turns of insulated copper wire closely together.

A current-carrying solenoid
When electric current passes through the solenoid, it produces a magnetic field similar to that of a bar magnet.

Pattern of the magnetic field produced by (a) Solenoid (b) Bar magnet
One end of the solenoid acts as the north pole, while the other acts as the south pole. Inside the solenoid, the magnetic field lines are straight, parallel, and equally spaced, indicating that the magnetic field is uniform throughout the interior. Outside the solenoid, the magnetic field pattern resembles that of a bar magnet.

Magnetic field produced by a solenoid and a bar magnet
The strong magnetic field produced inside the solenoid can magnetise a soft iron core placed inside it. The magnet formed in this way is called an electromagnet, which remains magnetic only while electric current flows through the solenoid.
Factors affecting the magnetic field of a solenoid:
1. Current through the solenoid
Increasing the current increases the magnetic field strength.
2. Number of turns per unit length
A greater number of closely wound turns produces a stronger magnetic field.
3. Core material
Inserting a soft iron core inside the solenoid greatly increases the magnetic field strength.

Soft iron core inside a current-carrying solenoid
4. Length of the solenoid
A long solenoid produces a more uniform magnetic field inside it.