What sort of data do credit card readers output? I know that many have drivers that automatically translate data into something useful, but what sort of raw data is there? I'm referring to card readers like the free ones given out by Square that input data via the microphone port of a device. Do those sort of readers just pull raw data straight from a card to be interpreted by the software, or do the card readers themselves do any sort of data formatting.
2 Answers
If Square are giving away readers why not get hold of one and have a look at it?
I've worked in the credit card industry and seen the transition from magnetic stripe readers (which give you an ASCII read of the data available on the mag stripe) to the chip card readers which need to decrypt the data from the chip.
The technology is not hard to use, in fact the companies selling the readers want to make it was easy as possible for you to read the card data when you have permission to do so.
What is your motivation for wanting to read the data?
If you are developing a commercial app which will read card details to take payments then interpreting the card reader data stream is the least of your worries, it's all the certification you will have to go through which will cause you headaches.
EDIT: Following up on the Mag Stripe link posted by DwB here is a link to background information on Chip & Pin with links to additional resources.

- 9,672
- 3
- 47
- 75
-
I'm actually bouncing around ideas for a POS that can use a tablet such as an iPad as the hardware platform. The actual payment software will most likely be Square once they release an API, but I would like a more secure card reader. I figured I could ask oon StackOverflow about data output rather than wading through APIs of card readers. – Nick Anderegg Jan 27 '11 at 00:27
-
1Sounds like an interesting app, the API's for mag stripe readers are pretty simple but it's all Chip & Pin these days so while the link posted by DwB is useful it's not the whole story. – Tony Jan 27 '11 at 08:35
-
Yes, I'm aware of the new chip and pin technology. There's not much of it in America though; I have a retail day job and 90% of the cards I see don't have anything more than a magnetic stripe. I did some of my own research on the data on cards, and it seems like it may actually be possible to modify a basic USB card readers to output to a microphone port. I think I'm going to write an Android app that translate microphone port data into human readable format, swipe a credit card, and see what comes up. – Nick Anderegg Jan 27 '11 at 14:49
-
1For development purposes you can pick up card readers cheaply (here's one on ebay UK for 99p: http://cgi.ebay.co.uk/Magnetic-Stripe-Card-Reader_W0QQitemZ160536965909QQcategoryZ16164QQcmdZViewItemQQ_trksidZp4340.m263QQ_trkparmsZalgo%3DSIC%26its%3DI%252BC%26itu%3DUCI%252BIA%252BUA%252BFICS%252BUFI%26otn%3D15%26pmod%3D360317598353%26ps%3D63%26clkid%3D6665331511102606559#ht_500wt_1089) You can use that to develop your code and see what the reader returns before spending more on the final product. Good luck with the project. – Tony Jan 27 '11 at 15:05
-
Oh, thank you very much! I never thought to check eBay, even though that's where I buy everything. – Nick Anderegg Jan 27 '11 at 23:35
-
Well, after some deductive reasoning, I think I've figured out the internals of a Square reader, and I didn't even need to take it apart! I think that it is nothing more than a magstripe reader head and an 8 or 14 pin IC chip that reads the analog magstripe data, digitizes it, and sends it straight into the microphone jack. It is probably a floating PCB held forward with some sort of spring. I realized that actually credit card readers interpret the data on-board, but that's not necessary if data is being streamed straight in to a high-powered device that can do the processing. – Nick Anderegg Jan 28 '11 at 20:55
-
Great, sounds like you are on your way. And you are correct, it's the device which needs to interpret the data. As the wikipedia describes, it's just a stream of ASCII data from the mag stripe. – Tony Jan 29 '11 at 08:17