A solenoid is a type of electromagnet formed by a helical coil of wire whose length is substantially greater than its diameter, which generates a controlled magnetic field. The coil can produce a uniform magnetic field in a volume of space when an electric current is passed through it.
Magnetic field lines and density created by a solenoid with surface current density
Examples of irregular solenoids (a) sparse solenoid, (b) varied-pitch solenoid, (c) non-cylindrical solenoid
An electromagnet is a type of magnet in which the magnetic field is produced by an electric current. Electromagnets usually consist of wire wound into a coil. A current through the wire creates a magnetic field which is concentrated in the hole in the center of the coil. The magnetic field disappears when the current is turned off. The wire turns are often wound around a magnetic core made from a ferromagnetic or ferrimagnetic material such as iron; the magnetic core concentrates the magnetic flux and makes a more powerful magnet.
Closeup of a large Henry electromagnet
Industrial electromagnet lifting scrap iron, 1914
Laboratory electromagnet. Produces 2 T field with 20 A current.
Magnet in a mass spectrometer