A magnetic stripe stores information in millions of tiny iron-based particles whose magnetic polarity is aligned in a specific sequence by an electromagnet (a solenoid). When the card is swiped, the moving stripe induces a voltage in the reader head, and the resulting signal is decoded into account numbers, expiry dates or door codes. Low-coercivity hotel key cards can be wiped by even weak magnets, while high-coercivity bank cards are far more resistant.
If you travel frequently, you may have faced a specific problem with key cards for hotel rooms: sometimes, when you swipe the card to open your room’s door, it just doesn’t work. A little perplexed, you try swiping it a few more times, but every time the light blinks red and you remain stranded outside your room.

You then head to the reception and convey your concerns to the staff. With an ‘I totally know why your card is not working’ smile on their face, they ask, “Did you put your smartphone or camera next to the keycard?” You sheepishly nod, the staff member takes the card from you, punches a few keys on the computer and returns it to you. You try the same key card again, and this time, it works!
So, what’s going on here? Why does putting a smartphone/camera next to the keycard upset its ability to open a door?
Before discussing this answer, let’s first take a quick look at how a magnetic stripe card works.
Recommended Video for you:
What Is A Magnetic Stripe Card?
A magnetic stripe card, also referred to as a swipe card or magstripe, is a plastic card with a magnetic strip attached on its surface. This stripe is made of tiny iron-based components whose magnetism can be modified and can therefore be used to store information. A magstripe is quite similar to a magnetic recording tape, which you might find in a videotape or a music cassette.

Magnetic stripe cards are widely used in hotel key cards to provide room access and credit/debit cards to handle purchases. They are also commonly used as identity cards for entrance to corporate premises and college campuses for a variety of purposes.
How A Magnetic Stripe Card Works?
The magnetic strip on a card can be ‘written’ or encoded with information because the tiny iron-based particles that make up the strip can be magnetized in different directions by a device that produces a strong magnetic field. This device is a ‘solenoid’, which is basically a coil wound into a tightly packed helix.

The wire is wound around a high-permeability, metallic core that produces a strong magnetic field when a current is passed through it. This device encodes the required information onto the stripe, which is then pasted on a plastic card.
How Does A Magnetic Stripe Reader Work?
When a card with a magnetic strip is moved back and forth over the ‘reader head’, a voltage is induced in the coils of the card reader device.

This voltage can be amplified and recorded electronically, which is finally read by a computer (or a processor installed within the reader) to authenticate a user (in the case of identity cards) or a transaction (in the case of credit/debit cards).
Demagnetizing A Magstripe: Why Are Hotel Key Cards Erased When Placed Next To Cellphones?
Access key cards for hotel rooms are often erased if placed next to a cell phone. However, thankfully enough, the same is not true for credit cards or any other bank transaction cards, and there’s a good reason behind that.
You see, magnetic strips are classified on the basis of their coercivity, which is basically a measure of their ability to withstand an external magnetic field. There are high-coercivity or HiCo cards, which are encoded and can withstand the presence of a very strong magnetic field (to the order of 4000 Oersted), and there are low-coercivity or LoCo cards, which are encoded with a low-intensity magnetic field (~300 Oe).

As you can imagine, LoCo cards are more suited for short-term applications, such as temporary access to hotel rooms. Such room key cards must be encoded/erased very frequently; therefore, cost-saving is very important for such businesses. LoCo cards are easy to manufacture and require only a low-intensity magnetic field source to encode data on them.
On the flip side, they are easily erased by anything that produces a moderately strong magnetic field — not so much the smartphone itself (modern phone electronics are too weakly magnetic to wipe a card), but the small but powerful magnets tucked inside magnetic phone cases, wallet cases, MagSafe accessories, AirPods cases, and clip-on credit-card holders. A loudspeaker pressed close to a hotel key card can do it too. Bank credit cards, on the other hand, are HiCo cards. Quite predictably, they are expensive to manufacture, require a strong magnetic field to encode data on them, and are highly resistant to most magnets people generally come into contact with.
That’s why you can casually keep your credit card and smartphone together in your pocket, but doing the same with a hotel room key card and a magnetic phone case is a recipe for an awkward trip back to reception. (Apple itself warns that the MagSafe magnets in newer iPhones can, in some cases, damage even credit-card mag stripes; so if you carry a MagSafe-style case, keep your cards in a separate sleeve.)
It’s worth noting that the magnetic stripe itself is on the way out. Mastercard announced in 2021 that it will phase magnetic stripes off new payment cards in most regions by 2024, with a full global retirement by 2033, as EMV chips, contactless tap-to-pay and tokenised mobile wallets like Apple Pay and Google Pay take over. So the “swipe” that this article describes — and the demagnetisation problems that come with it — will likely feel like quaint history to your kids.
References (click to expand)
- Explaining the Physics Behind Magstripes. Vassar College
- The Magnetic Stripe Technology. The University of Southern California
- Magnetic Strips | Physics Van | UIUC. The University of Illinois Urbana-Champaign
- D Ramsbrock. Magnetic Swipe Card System Security - UMD Computer Science. The University of Maryland, College Park













