Introduction: Magnetic Stripe Card Spoofer

Picture of Magnetic Stripe Card Spoofer
This instructable demonstrates how to use an electromagnet, a simple amplifier circuit, and a personal music player to induce signals into a magnetic stripe card reader, causing it to think that you have swiped a card through it.

This instructable assumes that you have basic knowledge of electronics and a cursory understanding of C++.

NOTE: This device is useless unless you already know the contents of a particular magnetic stripe card that you want to emulate. Thus, you can't use this device to do Something You're Not Supposed To Do unless you've already done something naughty to obtain the data from a magnetic stripe card you're not supposed to have.

Don't do naughty things. Your mother wouldn't like it.

Step 1: How It Works

Before going any further, read the document I've attached to this step, "A Day in the Life of a Flux Reversal" by Count Zero. This document is pretty much the bible on how magnetic stripes work, and you need to understand how data is encoded on to them and the basic formatting of the tracks on a given magnetic stripe card. I'm going to go get a cup of coffee; have it read by the time I get back.


Finished? Good.

As you will have learned from your reading, data is encoded on to magnetic stripes by means of magnetic flux reversal in the segments on the stripe. When the card is swiped past the card reader, the changing magnetic field of the passing flux reversals induce a current in the reader element, which is then decoded into binary bits, and the original data stored on the magnetic stripe is reconstructed.

So, in order to emulate a particular magnetic stripe, all we need to do is find a way to recreate the pattern of the way its magnetic field changes as it's being swiped past the reader. How are we going to do this? With an electromagnet!

As you may already know, an electromagnet is basically just a solenoid (coil of wire). When an electric current is passed through the coil, a magnetic field is created. By turning the electromagnet on and off rapidly, we can replicate the changing magnetic field of a magnetic stripe swipe.

The final piece of this puzzle is how to control the electromagnet. Well, we're trying to recreate a particular waveform of current through the solenoid in order to create a particular waveform of magnetism. What's a common way of storing waveforms and converting them to electric current? Sound files! So, all we have to do is encode the highs and lows representing the desired flux reversal pattern into a .wav file and play it back on an iPod or similar music player through the solenoid.

Music players designed to play sound through headphones do not produce enough current to drive the electromagnet in this project, so we will also have to construct a basic amplifier that the signal must be passed through before going to the electromagnet.

Step 2: Wind the Electromagnet

Picture of Wind the Electromagnet

Although a solenoid by itself will produce a magnetic field when electric current is passed through it, a much stronger magnetic field will be produced if the solenoid is wrapped around a core of ferrous material, such iron or steel.

For this project, I cut some small shapes out of 7 mil steel shim material to use as the core. I marked off a tab that is the part of the metal that will actually be inside of the reader slot, and cut some grooves to keep the solenoid in place. When electric current is passes through the coil, the entire steel shim is magnetized.

For the coil itself, just use standard enamel-coated magnet wire. Wrap it until you run out of wire or space. The more turns you have, the stronger your electromagnet will be. Before you start wrapping the wire, cover the part of the steel around which the wire will be wrapped with tape or something to keep the coil from shorting out if a sharp metal edge bites through the magnet wire's thin enamel coating.

After you have wrapped the solenoid, cover it in electrical tape to hold it in place, and solder some wires on to the end of the magnet wire leads.

Make sure not to get tape on the metal face that will be pushed up against the stripe reader's sensing element.

**Thanks to Steve Moskovchenko for helping me to work out the positioning of the coil. **

Step 3: Build the Amplifier

Picture of Build the Amplifier

Because a personal media player's headphone jack is not strong enough to drive our electromagnet, we must build a simple amplifier to drive it.

I just threw together this circuit from stuff I had lying around my desk. You can use pretty much any amplifier as long as it has enough gain to drive the electromagnet before it starts to distort. If you really don't want to build this circuit, you could even get some old powered computer speakers and replace one of the speakers with your electromagnet.

Anyway, to build the amplifier I'm using, you need the following items:

6-pin DIP socket
IC1 - LM386 op-amp
C1, C2 - 0.1 uF ceramic capacitors
C3 - 220 uF electrolytic capacitor
R1 - 10 ohm resistor
R2 - 5k trimmer potentiometer (actual value doesn't really matter, just as long as the max is large)
Audio cable with 1/8" phono jack on one end (I just cut the cord off some old headphones)
9V battery clip
Small switch
Prototyping board
Assorted jumper wires

Assemble the circuit as shown in the schematic. Make sure that the ground lead of the phono cable is connected to ground of the circuit. It does not matter if you connect the left or right channel of the phono cable to the input of the amplifier. Also, it does not matter which end of the solenoid is connected to ground, as long as one of them is.

I just soldered some jumper wires for the coil outputs that I connect up later with alligator clips later in order to keep the system modular.

Step 4: Create .wav File of Stripe Data

Finally, you need a a signal to send to the electromagnet. Edit the data array in the attached C++ program (written by geohot) to contain the data from the magnetic stripe that you want to emulate, and compile/run the program. It will output a file called text.wav that is your data file. Upload the file to your favorite music player (make sure it stays in .wav format), and you're in business!

There are two versions of the program in the zip that I've attached - one is for powerPC mac, and the other for PC/x86 mac.

If you are in need of some data to encode, see my other instructable.

Remember, don't be naughty. I'm not responsible for anything stupid/illegal you try do with this device.

Step 5: Hook It Up

Picture of Hook It Up

Now that you have built all the parts, it's time to play! Connect the music player, amplifier, and coil as shown in the picture. Insert the electromagnet's metal tab into the card reader slot. I recommend testing the device with a card reader/arduino setup as shown in my other instructable.

Step 6: Test It

Picture of Test It

Make sure the amplifier is on, and play the .wav file containing your data on the music player. If you've done everything right, the electromagnet should transmit the data from the card you're emulating.

If there's a problem with the transmission, try playing with different combinations of gain on the amplifier and volume on the music player. If the signal is too low, the magnetic field produced won't be strong enough, and if there is too much gain, the signal will be distorted.

Some music players cut off the first split second of things that they play. If this happens, your data will obviously not be transmitted properly. You might have to mess with the C++ code or use an audio editing program to add some silence at the beginning of the sound file if this is a problem. I was able to get around this with my iPod by making a playlist that has a .wav of silence before my data file.

Also, mess with the positioning of the metal tab you might have to move it around a little to find the "sweet spot" where its magnetic field is pest perceived by the reader. Additionally, make sure that it is thick enough to trigger the "card present" switch in the card reader.

It took me a few days to get settings that worked, so don't give up if you don't get it perfect on the very first try.

Good luck!


decodewav (author)2015-07-25

hi, im professional decoder, i can decode any sound file to track2!
if you need a good decoder contactme
this is im ICQ: 655803449
jabber :

decodewav (author)2015-07-25

hi, im professional decoder, i can decode any sound file to track2!

if you need a good decoder contactme
this is im ICQ: 655803449
jabber :

loko190 (author)2014-07-27

software automatic wav (sound) to ascii (track2) those interested I'll see how it works with live video skype ,, software decode automatic wav to track2 ,,, contact icq 677360044

mardinli (author)2014-02-09

any body know how is it work ?

Jstrjad (author)2013-07-17

What should the power output be? I am looking to purchase an amp but I don;t want to get it to small to be useful.

Output Power: 150mW (16Ohm), 16mW (300Ohm)
SNR: >=95dB (A weighted)
Distortion: <0.009%(10mW)
FR: 10Hz-100kHz
Impedance: 16Ohm-300Ohm
Power Supply: Built-in rechargeable Li-ion battery

asconine (author)2010-10-18

There is an app for the iPhone called square and when you sign up for it they send you a card reader that plugs into your headphone jack ( see The way this app works is by converting the info on the mag-stripe into audio. So could you use an audio file recorded off of the Square card reader rather then using this C++ app to create one?

goiano (author)asconine2013-05-16

amigo sou do brasil, se tiver interesse em ganhar dinheiro usando a inteligencia que voces tem ai aqui no brasil me mande e-mail

Grazfather (author)asconine2010-11-01

Yup, totally.

goiano (author)2013-05-16

Amigo sou do Brasil procuro amigos para trabalharmos na area !!! preçiso de info e faço dinheiro aqui no brasil e despacho o seu cach tenho msr206 preçiso somente de dados please add ou envie e-mail


lokivoid (author)2011-10-07

This type of spoofer will only work single track cards sadly.

VirtualBoxer (author)lokivoid2012-12-02

So will the direct output from a Square Register cut it?

~CableGuy (author)2012-11-18

oh, and if you need a high-tolerance pre-amp for the reading process, Find a cassette player! and unsolder the nearest ic to the mechanical parts and the read head. Good luck!

~CableGuy (author)2012-11-18

dude you gave me BILLIONS of money! thanks!

janny130 (author)2011-12-03

hello i was wondering if do anybody know anyting about tracks

maxell3775 (author)2011-02-10

Good Morning, Is there a way to get the data come straight from a usb port?, instead of having is to come from a audio source, that you could connect the spoofer to a USB port and send the data, and if it is not possible with this king of design, is there a USB SWIPE CARD like Justin longs in DIe Hard 4? when he tries to bypass woodlands server room door.

THank you

S33PlusPlus (author)maxell37752011-10-03

The first thing that comes to mind is a cheap USB sound card. All you'd need to do is crack it open and stuff a signal amp in, and depending on the particular card, a headphone jack that connects to the amp's output.

For the amp stage, you could cut size *way* down by using surface mount ICs and draw the power you need straight from the card's power supply (just make sure you keep the current below 500mA or you'll overload the USB port!)

Dlowe089 (author)2011-07-28

would it be possible to amplify the output of the initial card reader to record directly as audio through a microphone jack (mixer, some form of audio in), and then run that recording of the magnetic pass into the mp3 player and spoofer? It seems to me like a perfectly reasonable analog solution. But I am no expert in magnetic stripes, nor did I read the "A Day in the Life of a Flux Reversal" article (later, I'm just browsing instructables right now.)

maxell3775 (author)2011-02-10

another form would be to be able to connect to the mini usb port of an android smart phone and be able to send the signal.

jaycwallace (author)2010-11-04

Someone should start a website with known data formats for different card types and make this conversion to audio track on the server side. Seems it would be pretty handy to know the data format and just fill out the form with the required information encoded on the card, since most the information is often pretty apparent and/or in sight. It would generate the audio track and you could play it locally wherever you are.

fub1985 (author)2010-10-15

you say that a old powered computer speakers can be used.. what do you mean by this?

Pooloop (author)2010-09-16

You could make a video tutorial explaining how to create the .Wav file

Pooloop (author)2010-09-13

where did you buy the parts?

Pooloop (author)2010-09-13

where a put the card code in the c++ code?

Giggles12 (author)2008-08-03

I think nerds are hot!

NatureTM (author)Giggles122010-04-17

Fact Check:  We are ugly.

cody777 (author)NatureTM2010-09-09

speak for yourself
now if only i could find a girl who was hot AND as smart as me

waterppk (author)Giggles122008-08-07

Nice to hear someone has some love for us, but it doesn't make the cold nights any warmer :P

Natrix2494 (author)waterppk2010-06-24

exactly, knowing C++, C#, in highschool doesnt mean a thing to anyone.. we stay nerds cuz we know one day it will mean something..

 that kinda sorta just really made my day

nam2000 (author)2010-07-06

I wonder if you could somehow use the 12, 5 or 3.3 volt connections on the ipod 30 pin plug to power the device. It would be more expensive but smaller... here is a good website with the 30 pin port specs

seth3d (author)2008-11-13

WIP: I've created a PCB trace. The yellow lines signify where I'll be using wire jumps. If anyone is interested I'll post my results, negs, and Digi-Key part list.

macgeek10 (author)seth3d2009-11-17

There is an error in your pcb layout if i am not mistaken, the potentiometer is not hooked up as an adjuster, but rather as a simple 5k resistor, you need to change one of the traces to that center post instead.  I recommend Eagle for your pcb layout, it is lightweight and free, give it a try.

brokentesting (author)seth3d2008-12-30

Seth3d, This would be excellent. But seeing as it has been going on 2 months since your last post, I still hope you provide the details :) Nonetheless, I have subscribed to your Instructable area, just waiting on you to create a Instructable with the details of your PCB board. In the interim, I will try and contact you otherwise. Thanks for offering this Seth3d :) Keep us the cool work :)

seth3d (author)brokentesting2008-12-30

OK, here are the files in the zip file. The express PCB layout has top layer flipped for your printing convenience. I used the oxy-hydrogen-chloride etching method described here.

I haven't had much time recently to work with this much more. The amp is essentially a simple "square wave" modulator. I'm not 100% certain that the wave files would even work without the amplifier though others have stated it does with the right miniaturized electromagnet.

Additional materials not included in the part list include some solid core wire to use for jumpers, copper clad, an audio jack which was wrenched from the end of a broken headphone, and an LED with resistor to display power state. The LED can be excluded.

seth3d (author)seth3d2008-12-30

Here are both layers to the PCB, no sense wasting two sheets of transfer paper.

brokentesting (author)seth3d2008-12-30

Seth3d, You are the MAN! Very prompt reply indeed with all the necessary details :) Going to send you a Email shortly regarding some other stuff I think you'll find interesting. Thanks much Seth3d. You DA MAN!!!!!!!!!!!!!!!!!!!!!!!!!!! :)

crasymonkey89 (author)2009-10-22

is it possible to use these on say a card reader without a track?  I.e. a system wherein you simply hold the card to the reader?

ejreynolds (author)crasymonkey892009-11-14

Unfortunately, no.  That type of system is usually RFID (

finfan7 (author)2009-10-07

Could one use this setup but with a file that would enter all possible codes?  It might take a while to go through them all but unless there is a failure counter or a notification setup on the system it would be able to open any normal keycard door.

joe57005 (author)2008-08-03

Is the amplifier really necessary? if you put the coil a little closer to the reader, you only need as much power as the ipod normally gives to speakers. you could probably draw a suitable coil using conductive ink on a real [blank] card. depending on the size of the coil and the resistance of the lines, amplification should not be needed. Card readers use the same parts and very similar circuits as a cassette players, and you don't see any cd adapters use amplification or large coils, they just get the tiny coil very close.

hummelm (author)joe570052009-08-29

could you put conductive ink on the magnetic strip on a card somehow and just have the coil at the end of the card so the card could go in the insertion readers instead of just the swipe readers like the movie showed?

joe57005 (author)hummelm2009-08-31

not sure what you mean.

powerpants (author)joe570052008-08-03

i initially tried it with no amplifier and quite a few less of turns of wire that were placed directly against the sensor element, and getting the positioning right was really hard. also, when the positioning was exactly right, the data transmission was very error prone. stuff would show up, but a system like this is obviously useless unless it transmits the data with no errors. the amplifier really, really improves the reliability. anyway, it would definitely be cool to have a much more compact system, so if you come up with something better, let me know asap!

pacemaker (author)powerpants2009-01-03

I'm thinking of using the 30 pin connector. It would be much smaller. Let me know what you think. I don't want to fry my ipod touch lol.

joe57005 (author)powerpants2008-08-04

unfortunately i don't have anything to test with. (except a tape player, but that's a slightly different setup) I also don't have any conductive ink to play with. Sorry, but all i can offer are ideas.

bignaughtydog (author)joe570052008-11-24

can you not add some iron filings to the ink or just buy some?

joe57005 (author)bignaughtydog2008-11-26

yeah, that works. I've heard of people using graphite powder mixed with epoxy, but i wouldn't do that, too much resistance. I'd use copper or something more conductive.

_soapy_ (author)powerpants2008-11-16

You'll get better results by using a finer wire. This will let you have many, many more turns, and so a far higher magnetic field for the same current. The iPod (or whatever) will limit the current out anyway, so looking that up, then referring to a coil design website for the current capability of the wires you can get, will let you design the "perfect" coil. I made one of these devices many, many years ago from a tape-to-tape deck, as a proof of concept reader. I adjusted the depth by simply adding a bit of something (I don't recall, probably a bit of plastic) to raise the spacing so that the card slid past at the exact right height, rather than re-configuring the reader. Then you just do three passes to get all the data.

MioTheGreat (author)powerpants2008-08-05

How about drawing power from the iPod connector? In fact, you can both draw power and receive the output signals from that connector. I may have to write a little app for my iPod Touch for this...

powerpants (author)MioTheGreat2008-08-05

hey, that would be nifty! let me know what you come up with!

About This Instructable




More by powerpants:Magnetic stripe card spooferArduino magnetic stripe decoder
Add instructable to: