• Home
    Step by step guides
    How data is stored on punch cards

    One common program that was punched on cards was written in FORTRAN, which is one of the earliest programming languages. Let’s consider an extremely simple yet classic FORTRAN program, which prints “HELLO WORLD”. Here is an example:

    0001           PROGRAM HELLO
    0002           WRITE (*,*) 'HELLO, WORLD!'
    0003           STOP
    0004           END

    Each line of this program would be typed onto a punch card, one card per line. It starts with line numbers. The subsequent program itself is pretty straightforward. It defines a program named “HELLO” and its operation is to write the string ‘Hello, World!’ to the standard output.

    The representation on a punch card would be the punched holes in the card that correspond to each character on the line. Every character (both numbers and letters) and some special symbols had a specific hole pattern associated with it. For instance, ‘A’ might be represented as a hole in the first row of the card, ‘B’ as a hole in the second row, and so on. Using the IBM 029 card punch keypunch as an example, letters and digits were encoded using a combination of two punches, while most symbols used a single punch.

    Then the card reader would read these punched holes, interpret them back into the alphanumeric characters which made up the code of the FORTRAN program.