There is a long-standing belief that magnets can damage electronic devices placed nearby. Scientifically speaking, it is true that the magnetic field of a magnet affects electronic components. But in reality, can that influence actually damage the device, or in this case, your phone or computer?
How magnets affect electronic components
Concerns about the negative effects of magnets on electronic devices are not a myth and are actually scientifically grounded. However, before you get too worried, you can rest assured that damaging electronic devices with magnets is extremely difficult and extremely rare.
Magnets create magnetic fields, and magnetic fields can theoretically cause electronic components to malfunction or even fail. But the more important aspect here is how strong or weak the magnetic field is.
For example, your Wi-Fi router uses the same frequency as your microwave (both are in the 2.4GHz wavelength range). But the power level and focus of the energy emitted by the two devices are completely different. You can boil a cup of water in a microwave for a short time, but the amount of microwave energy emitted by the Wi-Fi router is too low to even raise the temperature of the cup of water, let alone boil it.
The same concept applies to magnets. Most magnets in our environment are very weak. They only produce enough magnetic fields to do the job they are designed to do. Neodymium magnets and large electromagnets can cause problems with electronic devices and even data loss in certain situations, but this is rare.
However, unless you work in an industrial, medical or scientific environment where very strong magnets are used, and you bring your device near those magnets while they are active, there is a real risk of damage to your device.
Let's look at the specific risks of magnets to two popular electronic devices: computers and phones.
Can magnets damage computers?

If your computer still uses a traditional magnetic hard drive (as opposed to the newer SSD solid state drives), there is always the possibility of the (very strong) magnetism damaging the hard drive.
However, that risk is extremely small, and unless you happen to stick a large neodymium magnet right on the hard drive or you leave your laptop in an industrial dehumidifier, there's nothing to worry about.
So if you’re wondering if your child has placed magnets or magnetic toys on your laptop or PC case, don’t worry. The risk is non-existent, and the magnetic field strength of those little magnets isn’t even close to the magnets inside the hard drive itself.
Can magnets damage phones?
Whether or not magnets can damage phones is a little more complicated.
The answer seems to be no, because phones don't typically have strong magnetic components inside. And in fact, this answer is true in most cases.
In short, the risk of damage caused by magnets to your phone or computer under normal use is very rare, almost non-existent.
Magnetic car mounts, magnetic cases, etc. pose very little risk. In fact, some phones even have relatively large magnets built right into them, like the MagSafe magnetic ring on the back of the iPhone.

However, there are also cases where magnets can cause minor problems with your phone, although not permanent damage. Phones use tiny magnets internally for a variety of purposes, such as in the image stabilization system for their lenses, so getting a magnet too close to the sensors can temporarily disable them.
For example, when a magnet is too close to the compass sensors inside the phone. The magnetic field can cause irregularities in the compass reading, leading to unexpected results when using apps that rely on the compass sensor. Such problems are almost always resolved immediately when you move the phone away from the magnetic source.