How Magnets Work
The short answer
Magnets work because moving electric charges, especially the spinning electrons within atoms, create tiny magnetic fields. In certain materials like iron, these individual atomic magnetic fields can align, combining to form a larger, observable magnetic force that attracts or repels other magnetic objects.
This explanation will rebuild your understanding of magnetism, starting from the fundamental behavior of electrons and showing how their properties lead to the forces we observe in everyday magnets.
By BasicsTutor · Created with AI and fact-checked · Updated Oct 18, 2026 · How we make lessons
All Magnetism Starts with Spinning Electrons
Every electron possesses an intrinsic property called 'spin,' which makes it act like a tiny, elementary magnet. This 'spin magnetic moment' is the most fundamental source of magnetism. Quantum mechanics describes electron spin as a fundamental angular momentum, even though the electron isn't physically spinning in the classical sense. This property is necessary to explain observations like the Stern-Gerlach experiment, where a beam of silver atoms is split into distinct paths by a magnetic field, corresponding to two possible spin orientations. People often think magnetism is a unique force separate from electricity, or that it just appears in special rocks. The misconception is that magnetism is a purely macroscopic phenomenon that doesn't originate from the very fabric of matter. Rather, it's deeply rooted in the quantum properties of subatomic particles. Because all matter contains electrons, all matter has the potential for magnetism. The question isn't "what makes something magnetic?" but "why isn't everything strongly magnetic?" The answer lies in how these tiny electron magnets arrange themselves and interact.
Imagine each electron is like a microscopic toy spinning top. Even if you can't see it physically spinning, it always has a preferred 'up' or 'down' orientation, and this orientation creates a tiny, invisible force field around it. - Electron = Spinning top - Spin = Intrinsic orientation/rotation - Magnetic Moment = Tiny force field created by the spinning top
- Electrons have intrinsic spin.
- Electron spin creates a tiny magnetic moment.
- This is the most fundamental source of all magnetism.
Moving Charges Generate Magnetic Fields
Any moving electric charge creates a magnetic field in the space around it. This is not just theoretical; it's a direct consequence of electromagnetism. This principle was empirically discovered by Hans Christian Ørsted in 1820 when he noticed a compass needle deflecting near a wire carrying electric current. Later, James Clerk Maxwell unified electricity and magnetism into a set of equations that mathematically describe how changing electric fields produce magnetic fields, and vice versa. Even the 'spin' of an electron, while not classical motion, results in an effective current loop that generates a magnetic field. Many believe that electricity creates an electric field and magnetism creates a magnetic field, and these are two entirely separate phenomena. The misconception is that magnets have an innate, static magnetic field unrelated to charge movement. In reality, all magnetic fields are fundamentally dynamic phenomena arising from the movement of charge. The 'magnetic field' of a permanent magnet isn't a static, inherent property of the material in isolation. It's the macroscopic manifestation of countless microscopic electron spins and orbital motions (which are equivalent to tiny current loops) acting in concert. If electrons stopped moving or spinning, there would be no magnetic fields.
Think of an electric current flowing through a wire like water flowing through a pipe. Just as flowing water can create a swirling vortex in a nearby bucket of water (a kinetic effect), flowing electric charge creates a swirling magnetic field around the wire. - Electric current = Flowing water - Magnetic field = Swirling vortex effect around the flow
- Moving electric charges create magnetic fields.
- This link was discovered by Ørsted and formalized by Maxwell.
- Even electron spin contributes to this effect, making it fundamental.
Atomic Magnetic Moments Align in Ferromagnetic Materials
In most materials, the magnetic moments of individual atoms (from electron spins and orbital motion) are randomly oriented or cancel each other out. However, in specific 'ferromagnetic' materials like iron, nickel, and cobalt, a quantum mechanical effect called 'exchange interaction' causes the magnetic moments of neighboring atoms to align spontaneously and strongly. This alignment occurs within microscopic regions called 'magnetic domains.' Inside each domain, all atomic magnets point in the same direction, creating a strong local magnetic field. The existence of these domains and their alignment properties have been observed and extensively studied using techniques like the Bitter technique or magnetic force microscopy. Many assume that if a material is magnetic, it's just 'magnetic' uniformly throughout, or that all materials can become strong magnets if exposed to a field. The misconception is that all materials respond to magnetic fields in the same way, or that ferromagnetism is just a simple sum of atomic moments without complex internal structure. A piece of iron can be unmagnetized even though it contains billions of tiny atomic magnets. Its overall magnetic state depends entirely on the collective organization of these atomic moments within domains. The material itself isn't inherently a "magnet"; it's a potential magnet, depending on how its domains are arranged.
Imagine a stadium full of people, each holding a small directional flag. - People = Atoms with magnetic moments - Flags = Individual atomic magnetic moments - Randomly oriented flags = Non-magnetic material - Groups of people in sections all pointing their flags the same way (domains) = Ferromagnetic material. - All sections aligning their flags in one direction = A magnetized ferromagnetic material.
- Ferromagnetic materials have strong atomic moment alignment.
- This is due to quantum mechanical 'exchange interaction'.
- Alignment happens within microscopic magnetic domains.
Magnetic Fields Exert Forces on Moving Charges and Other Magnetic Fields
A magnetic field doesn't just exist; it actively interacts with any other moving electric charge or magnetic dipole (like another magnet). This interaction manifests as a force, known as the Lorentz force, causing attraction, repulsion, or deflection. The existence of these forces is observed directly in phenomena like electric motors (where magnetic fields push on current-carrying wires), particle accelerators (where magnetic fields steer charged particles), and the simple act of two magnets attracting or repelling. Mathematically, the Lorentz force law (F = q(E + v x B)) quantifies how electric and magnetic fields act on charged particles. People often think magnets have an "attraction" or "repulsion" property as if by magic, or that the force is instantaneous action at a distance. The misconception is that the force is fundamental, rather than an interaction mediated by fields acting on charges. In reality, it's a consequence of how fields transmit energy and momentum. Counterintuitive Insight: The "force" between two permanent magnets isn't merely two objects pulling or pushing each other. It's the interaction of the external magnetic field of one magnet acting on the aligned moving charges (electron spins) within the other magnet, slightly changing their energy states and orientation to produce a net mechanical force. This explains why placing a magnet near certain materials causes no obvious interaction, while with others, a strong force is observed. The force is a consequence of energy minimization within the combined field system.
Imagine two dancers on a stage, each surrounded by their own invisible 'personal space' (magnetic field). When their 'personal spaces' overlap and they move in relation to each other, they experience pushes or pulls, causing them to adjust their positions. It's the interaction of their personal spaces, not just the dancers themselves, that creates the dynamic. - Dancers = Magnets or moving charges - Personal space = Magnetic field - Overlap and movement interaction = Lorentz force
- Magnetic fields exert forces on moving charges and other magnetic fields.
- This force is described by the Lorentz force law.
- Attraction/repulsion is a consequence of field interaction and energy minimization.
Magnetism is a State of Domain Alignment, Not a Fixed Property
The macroscopic magnetism of a ferromagnetic object is not an inherent, immutable property, but rather a state determined by the collective alignment of its magnetic domains. A material becomes "magnetized" when an external magnetic field causes these domains to grow at the expense of others, or to reorient their internal atomic moments to largely point in one direction. We can magnetize a piece of iron by rubbing it with a permanent magnet, aligning its domains. We can then demagnetize it by heating it above its Curie temperature (where thermal energy overcomes the exchange interaction, randomizing domains), or by repeatedly hitting it (physical shock can disrupt domain alignment), or by exposing it to an alternating magnetic field that gradually reduces in strength. These observations demonstrate that magnetism is a dynamic and reversible state. Many believe that once a material is a magnet, it always is, or that magnetism is like a 'paint' that covers an object. The misconception is that magnetization is permanent and indestructible, rather than a fragile structural arrangement of internal atomic magnets. The "strength" of a permanent magnet isn't solely about the material itself, but about the quality of its internal organization of magnetic domains. A highly "strong" magnet is one where nearly all its domains are perfectly aligned and resist external influences that would disorganize them. This explains why different grades of magnets exist (e.g., Neodymium vs. Ferrite), not just based on elemental composition, but on processing that optimizes domain structure.
Imagine a team of synchronized swimmers. - Individual swimmer = Magnetic domain - Unmagnetized state = Swimmers are swimming individually, randomly, canceling each other's overall movement. - Magnetized state = Swimmers are perfectly synchronized, all moving in the same direction, creating a powerful, unified motion. - Demagnetization = Swimmers lose their synchronization due to a loud noise (heat/shock) or conflicting instructions (alternating field).
- Magnetism is a state of domain alignment within materials.
- Materials are magnetized by aligning these domains.
- Demagnetization occurs when domain alignment is disrupted by heat or force.
Put it into practice
- Temporarily Magnetize a Ferromagnetic Object: Take a large steel nail and a strong permanent magnet. Stroke the nail repeatedly (about 20-30 times) in one direction with one pole of the magnet. Then, try to pick up small paperclips with the nail. This demonstrates how you can temporarily magnetize a ferromagnetic material by aligning its magnetic domains.
- Explore Magnetic Fields with a Compass: Use a simple compass to map the magnetic field around various permanent magnets (bar, horseshoe, disc). Observe how the compass needle aligns with the field lines, demonstrating the invisible field's direction and strength. Try placing two magnets near each other to see how their fields interact.
- Investigate Electromagnets: Construct a simple electromagnet by wrapping insulated copper wire around an iron nail and connecting the ends to a D-cell battery. Observe how the nail becomes magnetic when current flows and loses its magnetism when the circuit is broken, directly illustrating the link between moving charges and magnetic fields.