algorithm · 2025-04-21 · 5 min read
From IBM punch cards to your phone: a short history of the Luhn formula
Hans Peter Luhn filed the patent in 1954; by the time it was granted in 1960 it was already everywhere. The story of a hand-held checksum machine that outlived the mainframe.

Hans Peter Luhn (1896–1964) was a German-born IBM researcher better known in computer science for KWIC indexing and early work on information retrieval — the ancestor of the search engine. In 1954 he filed US patent 2,950,048, 'Computer for Verifying Numbers', granted in 1960. IBM's own profile covers his wider career.
A machine, not a program
The patent describes a hand-held mechanical device: operators dialled in an account number and the machine computed the check digit so keypunch errors could be caught before cards were fed to the mainframe. The doubling-and-subtract-nine trick was chosen because it could be done with gears and dials — which is also why the method is so easy to implement in a dozen lines today (what Luhn checks).
Adoption
- Credit-card networks standardised on it as magnetic-stripe cards spread in the 1960s–70s; it is now mandated by ISO/IEC 7812.
- The GSM standard adopted it for phone IMEI numbers.
- Canadian Social Insurance Numbers, Israeli and South African ID numbers, Greek tax IDs and many loyalty-card schemes use it.
- US National Provider Identifiers for healthcare apply Luhn with a fixed prefix.
Why it never got replaced
Stronger schemes existed by 1969 (Verhoeff), but Luhn was already embossed on hundreds of millions of cards. In payments, backwards compatibility beats elegance.
The formula is public domain; the patent expired in 1977. Explore it interactively in our Luhn lab.

Keywords: Hans Peter Luhn, Luhn history, IBM 1954, patent 2950048, check digit history, IMEI Luhn
Frequently asked questions
Who invented the Luhn algorithm?
Hans Peter Luhn, an IBM researcher, who filed the patent in 1954. It was granted in 1960.
Is the Luhn algorithm patented?
Not anymore. The 1960 patent expired decades ago and the method is public domain.