LogicGates.org Open the simulatorSimulator

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.

HELLO,WORLD121100000000000000000000000000000000000000000000000000000000000000000000000000000000011111111111111111111111111111111111111111111111111111111111111111111111111111111122222222222222222222222222222222222222222222222222222222222222222222222222222222233333333333333333333333333333333333333333333333333333333333333333333333333333333344444444444444444444444444444444444444444444444444444444444444444444444444444444455555555555555555555555555555555555555555555555555555555555555555555555555555555566666666666666666666666666666666666666666666666666666666666666666666666666666666677777777777777777777777777777777777777777777777777777777777777777777777777777777788888888888888888888888888888888888888888888888888888888888888888888888888888888899999999999999999999999999999999999999999999999999999999999999999999999999999999911020304050607080

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.

"CARD 80", column by column
CharacterPunches12-bit columnEBCDIC (hex)
C12-3100001000000C3
A12-1100100000000C1
R11-9010000000001D9
D12-4100000100000C4
spacenone00000000000040
88000000000010F8
00001000000000F0

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.

CharacterPunches12-bit columnEBCDIC (hex)
spacenone00000000000040
00001000000000F0
11000100000000F1
22000010000000F2
33000001000000F3
44000000100000F4
55000000010000F5
66000000001000F6
77000000000100F7
88000000000010F8
99000000000001F9
A12-1100100000000C1
B12-2100010000000C2
C12-3100001000000C3
D12-4100000100000C4
E12-5100000010000C5
F12-6100000001000C6
G12-7100000000100C7
H12-8100000000010C8
I12-9100000000001C9
J11-1010100000000D1
K11-2010010000000D2
L11-3010001000000D3
M11-4010000100000D4
N11-5010000010000D5
O11-6010000001000D6
P11-7010000000100D7
Q11-8010000000010D8
R11-9010000000001D9
S0-2001010000000E2
T0-3001001000000E3
U0-4001000100000E4
V0-5001000010000E5
W0-6001000001000E6
X0-7001000000100E7
Y0-8001000000010E8
Z0-9001000000001E9
&1210000000000050
-1101000000000060
/0-100110000000061
¢12-8-21000100000104A
.12-8-31000010000104B
<12-8-41000001000104C
(12-8-51000000100104D
+12-8-61000000010104E
|12-8-71000000001104F
!11-8-20100100000105A
$11-8-30100010000105B
*11-8-40100001000105C
)11-8-50100000100105D
;11-8-60100000010105E
¬11-8-70100000001105F
,0-8-30010010000106B
%0-8-40010001000106C
_0-8-50010000100106D
>0-8-60010000010106E
?0-8-70010000001106F
:8-20000100000107A
#8-30000010000107B
@8-40000001000107C
'8-50000000100107D
=8-60000000010107E
"8-70000000001107F

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)LettersFigures
00000blankblank
00001E3
00010LFLF
00011A-
00100spacespace
00101S'
00110I8
00111U7
01000CRCR
01001DENQ
01010R4
01011JBEL
01100N,
01101Fnational use
01110C:
01111K(
10000T5
10001Z+
10010L)
10011W2
10100Hnational use
10101Y6
10110P0
10111Q1
11000O9
11001B?
11010Gnational use
11011FIGSFIGS
11100M.
11101X/
11110Vvaries
11111LTRSLTRS

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.