A solenoid's magnetic field looks just like a bar magnet's, which is exactly why wrapping one around iron makes a switchable electromagnet.
A solenoid's field looks just like a bar magnet's: uniform and parallel inside, looping around outside, because each turn's field adds to the next.
A solenoid is a coil of many circular turns of insulated copper wire, wound tightly in the shape of a cylinder. Pass a current through it, and its magnetic field pattern turns out to look remarkably similar to a bar magnet's: one end behaves like a north pole, the other like a south pole.
Inside the solenoid, the field lines run as straight, parallel lines, meaning the field is uniform at every point inside it (just like at the centre of a single circular loop, but stretched along the whole length of the coil). Outside, the field lines loop around from one end to the other, exactly like a bar magnet's external field.
This strong, uniform field inside a solenoid can magnetise a piece of magnetic material, like a soft iron rod, placed inside the coil. The magnet created this way is called an electromagnet.
Unlike a permanent bar magnet, an electromagnet's field can be switched on or off (just by controlling the current) and its strength adjusted, which is why electromagnets are used everywhere from electric bells and cranes to MRI machines.
Key exam points
Watch it explained
Magnetic field due to solenoid | Class 10 | Animated Explanation in 3 Minutes · Toppscholars