Think of a wire with an electric current flowing through it. Remember, electric current is made by electrons flowing through the wire. The flow of electrons through a wire is much like the flow of water through a pipe. As the electrons flow through the wire, they are all lined up together and are going in the same direction. A magnet is created when all the electrons in a metal bar are lined up in the same direction. This is also what happens to a wire with an electric current flowing through it. A wire with an electric current flowing through it has a magnetic field.
Just as the magnetic field is strongest near a magnet and decreases in strength with distance, the magnetic field around a wire is also strongest near the wire.
Magnetic Field
Where is the magnetic field strongest if there is an electric current flowing through a wire?
The magnetic field is strongest closest to the wire.