Punch Cards

A punch card is a piece of card stock with holes in it, and almost everything strange about the code it carries comes from that one fact. Type a line, or punch the holes yourself and see what character you made.

The card

What a reader gets back

One column, close up

The card is 80 columns across, which on a phone is about four pixels each. That is honestly what a punch card looks like, so here is the column you picked, enlarged. The holes are buttons: punch and unpunch them and watch the character above the column appear, change, or stop being a character at all.

    Column
    1
    Character
    blank
    Zone punch
    none
    Digit punch
    none
    Holes
    0
    FORTRAN field
    none

    Why an 029 character uses at most three holes

    The twelve rows are not numbered one to twelve. From the top they run 12, 11, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. The top three are the zone rows and the bottom nine are the digit rows, and a character is a zone plus a digit: A is 12 and 1, J is 11 and 1, S is 0 and 2. A bare digit is one hole. A space is no holes at all.

    That arrangement is not an aesthetic choice. A character in this code is a zone plus a digit, so no valid character needs more than three holes. That is a limit on the CODE and not on the card, and the 029 itself makes the difference plain: hold the MULT PCH key down and an operator can put as many rows into one column as they like. The lace card below is the proof, since it is twelve holes in every column and it is a real object.

    Every hole does remove material, and a column cut too far through tears in the feed rollers. But the stronger story, that the character set was held to three holes in order to keep cards intact, is not established by anything cited here, and it is the kind of claim this site is supposed to separate from what actually happened. Punch a fourth hole into any column above and the page will say so, because it is checking the code and not the cardboard.

    Punch all twelve rows in all eighty columns and you get what the era called a lace card: real, made as a prank, and notorious for jamming in a reader.

    Why FORTRAN starts in column 7

    One card was one line, so the card's eighty columns became the line's eighty columns, and the fields on the card became the syntax. Columns 1 to 5 held a statement label. Column 6 marked a continuation of the line before it. The statement itself ran from 7 to 72. Columns 73 to 80 held a sequence number, because a dropped deck was a real event with a real recovery: feed it through a sorter and get your program back in order. Programs that skipped the sequence number could not be put back by machine, and recovery meant doing it by hand.

    The eighty-column limit that still shows up in style guides descends from this card, and so does the seventy-two column one, through a chain of intermediate conventions rather than in one step.

    The three-hole rule is a budget, and it is not the first one. Baudot's tape had been paying for its alphabet in punched holes since the 1870s, where the cost was wear on the punch rather than a torn card. Both ran short of single-hole codes and both answered by combining two things at once: the tape shifts in time, and a card column puts a zone punch and a digit punch in the same space.

    These ran in this browser when the page loaded. Each claim, whether it held, and the number behind it.

    Each claim, whether it held, and the values behind it
    claimheldmeasured
    all 26 letters are rebuilt from the zone-plus-row rule and match the stored table exactlyyesA to I are zone 12 with digits 1 to 9, J to R are zone 11, S to Z are zone 0 starting at 2; the table is checked against the RULE rather than against itself
    each of the 10 digits is a single punch in the row of the same nameyesrows 0 to 9 carry their own digit and nothing else, which is why a numeric field needs no zone punch at all
    across the whole 029 set the widest character needs 3 holes, and none exceeds 3yesevery one of the 63 characters was enumerated and the widest needs 3; why the code stops there is argued in the notes, and this row measures only that it does
    all 63 characters survive the round trip from character to holes and backyesno two characters share a hole pattern, so there is exactly one way to read any column; the page keeps no second copy of the text and reads it off the holes
    all 5 characters an 029 cannot punch are refused rather than substitutedyeslowercase does not exist on this keypunch and neither do braces; A splits into 1 zone punch and 1 digit punch, which is the rule above

    What is real here, and what is not

    1928 dates the card, and the machine on this page has four dates in it

    The pill says 1928 because that is the year of the eighty-column card whose shape and dimensions everything here is drawn to. The rest of what you are pressing is later. The twelve-row layout, with the two zone rows above the ten digits, settled around 1930. The character set is the IBM 029 keypunch of 1964, which is why a letter takes at most three holes and why some punctuation is where it is. And the column rules the page explains at the end are FORTRAN’s conventions, later again. One date on a machine assembled from four is the shortest true thing that can go on a pill, and this is what it leaves out.

    The encoding is real, and it runs both ways

    The character set is the IBM 029 keypunch set, written into the source as one twelve-bit string per character in physical row order, so it can be checked line by line against the published table. The holes are the only state this page keeps: the character shown above each column is looked up backwards out of that same table from whatever holes are actually punched. Type a line and punch a hole by hand and the two cannot disagree, because there is no second copy of the text. The three-hole claim is verified against the table when the page loads rather than asserted in prose.

    The card size is real; the hole pitch is close

    7-3/8 by 3-1/4 inches, 80 columns, 12 rows, rectangular holes: all to spec. The spacing used to lay the grid out, 0.087 inches across and 0.25 inches down, is the commonly cited figure and fits correctly inside the real card, but it is not traced from an IBM dimensional drawing. Treat the drawing as accurate in proportion, not as a reproduction.

    The printed digits are texture, not a facsimile

    A real card had its row digit printed at every one of the 800 digit positions, and the column numbers printed along the bottom edge for all eighty. Both are here, but at 80 columns the per-position digits are around four pixels, so they read as the grain of the stock rather than as numbers, and only every tenth column number is printed. The row labels down the left edge are this page's addition; a real card did not need them because the printed grid did the same job.

    Lowercase is silently uppercased, the way the machine did

    An 029 keyboard had no lowercase, so typing lowercase here punches the capital. That is the machine's behaviour, not a shortcut. Characters genuinely outside the set are refused and named rather than approximated. Typing straight onto the card, one key per column, also has no backspace, for the same reason the machine had none: the only fix was to scrap the card and punch a new one.

    Nothing here jams, and nothing here is a deck

    A lace card buckles and stops a reader. This page draws the card and says so; it does not simulate the feed, the rollers, or the jam. The card does not warp, wear, or absorb humidity, all of which mattered. And this is one card: the deck, the sorter, and what happened when you dropped one are a bigger subject.

    This is the keypunch, not the shop

    Punching a card was the fast part. The slow part was everything after it: the deck, the job, the wait, and the printout that told you about the missing comma. That is a machine of its own and it is on the studio's list.

    Sources