Punch card generator and reader
Type text and see it punched into an 80-column card or a strip of paper tape. Click any hole to add or remove it and read what the holes say.
Column 1: punches 12-8, reads as H, EBCDIC C8.
Rows run 12, 11, 0, 1 to 9 from the top; the cut corner is top left and column 1 is at the left. A column that is no known character reads as ▯.
How a column stores a character
A card column has 12 positions. Rows 0 to 9 are the digits, and rows 12 and 11 above them are the zones; row 0 doubles as a zone. A digit is a single hole. A letter is a zone hole plus a digit hole: A to I are 12 with 1 to 9, J to R are 11 with 1 to 9, and S to Z are 0 with 2 to 9. Space is a column with no holes. Read as binary, the column is a 12-bit number with the top row as the top bit.
| Character | Punches | 12-bit column | EBCDIC (hex) |
|---|---|---|---|
| C | 12-3 | 100001000000 | C3 |
| A | 12-1 | 100100000000 | C1 |
| R | 11-9 | 010000000001 | D9 |
| D | 12-4 | 100000100000 | C4 |
| space | none | 000000000000 | 40 |
| 8 | 8 | 000000000010 | F8 |
| 0 | 0 | 001000000000 | F0 |
The EBCDIC byte follows from the punches: the zone chooses the high hex digit and the digit punch the low one, so the card code and EBCDIC line up. 80 columns of 12 rows is 960 hole positions per card.
The card code on this page
This page uses the card code of the IBM 029 keypunch: capitals, digits, space and 26 symbols. Apart from &, - and /, each symbol is an 8 punch plus one other punch, with or without a zone. The glyph printed for a few codes differs between keyboards. Punch patterns not listed here are not read.
| Character | Punches | 12-bit column | EBCDIC (hex) |
|---|---|---|---|
| space | none | 000000000000 | 40 |
| 0 | 0 | 001000000000 | F0 |
| 1 | 1 | 000100000000 | F1 |
| 2 | 2 | 000010000000 | F2 |
| 3 | 3 | 000001000000 | F3 |
| 4 | 4 | 000000100000 | F4 |
| 5 | 5 | 000000010000 | F5 |
| 6 | 6 | 000000001000 | F6 |
| 7 | 7 | 000000000100 | F7 |
| 8 | 8 | 000000000010 | F8 |
| 9 | 9 | 000000000001 | F9 |
| A | 12-1 | 100100000000 | C1 |
| B | 12-2 | 100010000000 | C2 |
| C | 12-3 | 100001000000 | C3 |
| D | 12-4 | 100000100000 | C4 |
| E | 12-5 | 100000010000 | C5 |
| F | 12-6 | 100000001000 | C6 |
| G | 12-7 | 100000000100 | C7 |
| H | 12-8 | 100000000010 | C8 |
| I | 12-9 | 100000000001 | C9 |
| J | 11-1 | 010100000000 | D1 |
| K | 11-2 | 010010000000 | D2 |
| L | 11-3 | 010001000000 | D3 |
| M | 11-4 | 010000100000 | D4 |
| N | 11-5 | 010000010000 | D5 |
| O | 11-6 | 010000001000 | D6 |
| P | 11-7 | 010000000100 | D7 |
| Q | 11-8 | 010000000010 | D8 |
| R | 11-9 | 010000000001 | D9 |
| S | 0-2 | 001010000000 | E2 |
| T | 0-3 | 001001000000 | E3 |
| U | 0-4 | 001000100000 | E4 |
| V | 0-5 | 001000010000 | E5 |
| W | 0-6 | 001000001000 | E6 |
| X | 0-7 | 001000000100 | E7 |
| Y | 0-8 | 001000000010 | E8 |
| Z | 0-9 | 001000000001 | E9 |
| & | 12 | 100000000000 | 50 |
| - | 11 | 010000000000 | 60 |
| / | 0-1 | 001100000000 | 61 |
| ¢ | 12-8-2 | 100010000010 | 4A |
| . | 12-8-3 | 100001000010 | 4B |
| < | 12-8-4 | 100000100010 | 4C |
| ( | 12-8-5 | 100000010010 | 4D |
| + | 12-8-6 | 100000001010 | 4E |
| | | 12-8-7 | 100000000110 | 4F |
| ! | 11-8-2 | 010010000010 | 5A |
| $ | 11-8-3 | 010001000010 | 5B |
| * | 11-8-4 | 010000100010 | 5C |
| ) | 11-8-5 | 010000010010 | 5D |
| ; | 11-8-6 | 010000001010 | 5E |
| ¬ | 11-8-7 | 010000000110 | 5F |
| , | 0-8-3 | 001001000010 | 6B |
| % | 0-8-4 | 001000100010 | 6C |
| _ | 0-8-5 | 001000010010 | 6D |
| > | 0-8-6 | 001000001010 | 6E |
| ? | 0-8-7 | 001000000110 | 6F |
| : | 8-2 | 000010000010 | 7A |
| # | 8-3 | 000001000010 | 7B |
| @ | 8-4 | 000000100010 | 7C |
| ' | 8-5 | 000000010010 | 7D |
| = | 8-6 | 000000001010 | 7E |
| " | 8-7 | 000000000110 | 7F |
Paper tape: frames, tracks and shifts
Paper tape holds one character per frame across the width of the tape. Baudot tape has 5 tracks, so 32 codes; ASCII tape has 7 data tracks and an 8th for parity. A row of smaller feed holes runs along the tape, between track 2 and 3 on five-track tape and between track 3 and 4 on eight-track tape. The track numbering and drawing direction are this page's convention; the code values are what matter.
Baudot (ITA2) uses two shift codes, so that most of the 32 codes mean a letter or a figure depending on the last shift. The codes marked national use or varies differ between countries or sources, so this page does not read them. Parity on ASCII tape is even: A needs no parity hole and C needs one, as the FAQ shows.
| Code (track 5 to 1) | Letters | Figures |
|---|---|---|
| 00000 | blank | blank |
| 00001 | E | 3 |
| 00010 | LF | LF |
| 00011 | A | - |
| 00100 | space | space |
| 00101 | S | ' |
| 00110 | I | 8 |
| 00111 | U | 7 |
| 01000 | CR | CR |
| 01001 | D | ENQ |
| 01010 | R | 4 |
| 01011 | J | BEL |
| 01100 | N | , |
| 01101 | F | national use |
| 01110 | C | : |
| 01111 | K | ( |
| 10000 | T | 5 |
| 10001 | Z | + |
| 10010 | L | ) |
| 10011 | W | 2 |
| 10100 | H | national use |
| 10101 | Y | 6 |
| 10110 | P | 0 |
| 10111 | Q | 1 |
| 11000 | O | 9 |
| 11001 | B | ? |
| 11010 | G | national use |
| 11011 | FIGS | FIGS |
| 11100 | M | . |
| 11101 | X | / |
| 11110 | V | varies |
| 11111 | LTRS | LTRS |
Some equipment drops back to letters after every space; this page does not.
Read this card
The first 12 columns of a card. Work out each column from the rows, then check yourself.
Show the answer
It reads NAND 7400. The first column has punches 11-5, which is N.
Common mistakes
- Treating rows 12 and 11 as digits. They are zones. Row 0 is a digit alone and a zone beside another digit.
- Forgetting the shift on Baudot tape. The same frame is E or 3. Reading needs the last LTRS or FIGS, and the shift stays on across a space.
- Reading tape bits in the wrong order. Here track 1 is the least significant bit. Other sources draw or number the tracks the other way, so check before comparing patterns.
- Counting the parity hole as data. On ASCII tape the 8th track only makes the number of holes even.
Questions
How does a punch card store a letter?
Each column has 12 rows, and a character is a pattern of punches in one column. A digit is one punch, in the row of that digit. A letter is two: a zone punch (row 12, 11 or 0) and a digit punch (1 to 9). A is 12 and 1, J is 11 and 1, S is 0 and 2. A card has 80 columns, so it holds 80 characters.
Why do the letters need two holes?
Ten digits fit in ten rows, but 26 letters do not. Using a zone punch with a digit punch gives 3 zones times 9 digits, which is more than enough, and keeps the three groups A to I, J to R and S to Z in order. Of the 4,096 possible patterns in a column, this page's card code uses 63.
How does a card become EBCDIC?
A card reader senses the 12 rows of each column. For letters and digits, EBCDIC follows the card code: the zone punch gives the high hex digit (12 gives C, 11 gives D, 0 gives E, none gives F for digits) and the digit punch becomes the low hex digit. A, which is 12 and 1, is C1. The card code table on this page is checked against Python's cp037 EBCDIC codec.
What are LTRS and FIGS on Baudot tape?
Five holes give only 32 codes, so the same code means a letter or a figure depending on the last shift frame. LTRS (11111) switches to letters and FIGS (11011) to figures. Spaces, carriage return and line feed are the same in both. This page starts in letters, adds a shift only when the set changes, and leaves the shift on across a space, so "1 2" is the 4 frames 27, 23, 4, 19.
Why does ASCII tape have a parity hole?
ASCII has 7 bits, and the 8th track carries a parity bit so that a frame never has an odd number of holes. A is 41 in hex with two bits set, so its parity bit stays clear and the frame is 41. C is 43 with three bits set, so the parity track is punched and the frame is C3. A single missed or extra hole then shows up as an odd frame.
Why are there no lowercase letters?
The card code here is capitals, digits and symbols, and Baudot has one case of letters. Lowercase text typed above is punched as capitals on the card and on Baudot tape. ASCII tape keeps the case you type.
For other text encodings, see the ASCII table and Base64; for numbers in bits, the binary converter.