 A solenoid is a coil of wire. Despite being something so simple, solenoids have many useful applications. They are used in electromagnets, electromagnetic locks and many other areas. Solenoids generate a magnetic field when a current is run through it. The magnetic field they generate is what makes them so useful. We analyze the magnetic field around a loop by looking at the magnetic field due to each part of the loop and then adding them together to get the overall magnetic field. We can do the same to get the magnetic field of a solenoid. We know the magnetic field of a loop now, so we don't need to split the solenoid into many small sections. Instead, we could split the solenoid into multiple loops and consider the overall magnetic field. Let's say we had a current going in to the right and out to the left. Then each individual loop has a current going down in front and up behind. Each loop would have a magnetic field going to the right inside the loop and going to the left outside the loop. Since all these magnetic fields point in the same direction, they all reinforce each other. Meaning the overall magnetic field of the solenoid would be pointing to the right in the middle of the solenoid and to the left outside of the solenoid. The magnetic field around a solenoid is the same as the magnetic field around a bar magnet. The difference isn't how they are generated. A bar magnet has a permanent magnetic field. While you can switch the magnetic field around a solenoid on and off by switching the current on and off. This has many practical applications. Electromagnets is one such application. An electromagnet is exactly as its name describes. A magnet that is created by electricity. It's basically a solenoid. When you run a current through it, it acts like a magnet. When you turn off the current, it loses its magnetic field and stops acting like a magnet. These are used in electromagnetic locks. There is generally an armature plate that the electromagnet is attracted to once a current is run through it.