Your smartphone contains dozens of tiny magnets and magnetic sensors, each handling a different job. They move your camera lens, produce sound from your speakers, align your phone on a wireless charger, and even detect which direction you’re facing. Here’s how each system works.
Camera Autofocus and Image Stabilization
The camera module is one of the most magnet-intensive parts of a modern phone. Inside it, a component called a voice coil motor uses a small permanent magnet and a coil of wire to physically move the lens back and forth. When you tap to focus, the camera sensor measures the distance to your subject, then sends a current through the coil. That current interacts with the magnetic field, pushing the lens forward or backward until the image is sharp. The whole process takes milliseconds.
The same principle powers optical image stabilization (OIS). As your hand shakes slightly, gyroscopes detect the movement, and the voice coil motor nudges the lens in the opposite direction in real time. High-end phones from Apple and Samsung use multi-axis voice coil motors that can compensate for shake in several directions at once, which is why handheld video looks so much smoother than it did a decade ago. These motors are silent, fast, and small enough to fit inside a camera bump just a few millimeters thick.
The magnets themselves are made from neodymium iron boron, the strongest type of permanent magnet commercially available. Besides neodymium, iron, and boron, these magnets often contain small amounts of praseodymium and dysprosium to boost performance and heat resistance. Their high force density relative to their size is what makes them practical for the tight space inside a phone camera.
Speakers and Sound
Phone speakers work on the same basic principle as full-size loudspeakers, just miniaturized. A permanent magnet sits next to a tiny coil of wire attached to a thin diaphragm. When an electrical audio signal passes through the coil, it creates a fluctuating magnetic field that pushes and pulls against the fixed magnet. That motion vibrates the diaphragm, which moves air and produces sound.
Engineers have refined microspeaker designs to squeeze better audio from these small components. Some phones use a combined permanent magnet layout, where magnets sit both inside and outside the voice coil. This concentrates the magnetic force more efficiently, which lets the diaphragm vibrate across a broader range of frequencies and produce fuller, richer sound from a speaker barely larger than a fingernail.
Wireless Charging Alignment
If you’ve used MagSafe on an iPhone or any Qi2-certified charger, you’ve felt a ring of magnets snap your phone into position on the charging pad. That satisfying click isn’t just convenient. It solves a real engineering problem: wireless charging works by transferring energy between two coils (one in the charger, one in the phone), and even a small misalignment between those coils wastes energy and generates heat.
The Qi2 standard, managed by the Wireless Power Consortium, builds magnetic alignment directly into the specification. A ring of magnets in the phone locks onto a matching ring in the charger, ensuring the coils overlap precisely every time. This improves charging efficiency, enables faster charging speeds, and opens the door to accessories like wallets, battery packs, and even AR headset mounts that magnetically attach to the back of the phone.
The Compass and Navigation
Your phone can tell which direction you’re facing because it contains a magnetometer, a sensor that detects Earth’s magnetic field. The sensor works by measuring something called the Hall effect: when electrons flow through the sensor material in the presence of a magnetic field, they get deflected to one side, creating a small voltage difference. By measuring that voltage across multiple axes, the phone calculates the direction and strength of the surrounding magnetic field.
This is what powers the compass app and helps mapping software rotate the map to match your orientation. The magnetometer also works alongside GPS and accelerometers to improve location accuracy, especially in situations where GPS signals bounce off buildings or temporarily drop out.
Detecting Flip Cases and Accessories
Many phones can detect when a magnetic flip cover is closed and automatically turn the screen off. This uses a Hall effect sensor similar to the magnetometer but designed for a simpler job: sensing whether a small magnet (embedded in the case’s cover flap) is nearby. As the magnet approaches the sensor, the voltage it generates crosses a threshold, and the phone registers the case as closed. Pull the cover open, the magnet moves away, and the screen wakes up. It’s a low-power, reliable system with no moving parts to wear out.
What Magnets Don’t Affect
A common concern is whether the magnets in a phone or its accessories can erase your data. They can’t. Modern smartphones store data on flash memory chips, which are entirely electronic and non-magnetic. Unlike old hard drives that stored information by magnetizing tiny regions on a spinning disk, flash memory uses electrical charges trapped in semiconductor cells. A consumer-grade magnet has no effect on this type of storage.
Magnets and Medical Devices
While phone magnets pose no risk to your data, they can potentially interfere with implanted medical devices. The FDA recommends keeping cell phones and smartwatches at least six inches (15 centimeters) away from cardiac defibrillators and pacemakers. The concern is that magnets in these devices could activate a built-in safety mode in the implant, temporarily changing how it functions. For most people this is irrelevant, but if you have an implanted heart device, keeping your phone in a pants pocket rather than a breast pocket is a simple precaution.

