A magnetic field is a vector field that exerts forces on moving charges, current-carrying wires, and magnetic dipoles. It is represented by the vector and measured in tesla. Unlike the electric field, which acts on charge whether it is moving or not, the magnetic field acts on charge only when the charge has velocity relative to the field. Field lines are drawn so that the tangent to the line gives the direction of , and the density of lines indicates field strength. Around a bar magnet, the field lines loop from the north pole to the south pole outside the magnet, while inside the magnet the loop closes.
The magnetic field is especially important because it connects motion and force in a way that electric fields do not. A magnetic field by itself does no work on an isolated point charge, because the magnetic force is always perpendicular to the velocity of the charge. That means magnetic fields can change the direction of motion without changing the particle’s speed. This is why magnetic fields are so useful in bending charged-particle paths, selecting velocities, and storing energy in electromagnetic systems.