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.

Born in the punch-card era to catch keypunch errors.
Born in the punch-card era to catch keypunch errors. — © Vitor Diniz · Pexels

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.

From IBM hardware to every phone's IMEI.
From IBM hardware to every phone's IMEI.

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.

On this site

External references

Related articles

من بطاقات IBM المثقّبة إلى هاتفك: تاريخ موجز لمعادلة لون — النسخة العربية

قدّم هانس بيتر لون طلب البراءة في 1954؛ وحين مُنحت في 1960 كانت المعادلة منتشرة في كل مكان. قصة آلة مجموع تحقق محمولة عاشت أطول من الحاسوب المركزي.

كان هانس بيتر لون (1896–1964) باحثًا في IBM ألماني المولد، اشتهر في علوم الحاسوب بـفهرسة KWIC وأعمال مبكرة في استرجاع المعلومات — سلف محرك البحث. في 1954 قدّم طلب البراءة الأمريكية 2,950,048 «حاسوب للتحقق من الأرقام»، ومُنحت في 1960. ملف IBM عنه يغطي مسيرته الأوسع.

آلة لا برنامج

تصف البراءة جهازًا ميكانيكيًا محمولًا: يُدخل المشغّلون رقم الحساب فتحسب الآلة خانة التحقق كي تُكتشف أخطاء التثقيب قبل إدخال البطاقات إلى الحاسوب المركزي. اختيرت حيلة المضاعفة والطرح من تسعة لأنها قابلة للتنفيذ بتروس وأقراص — وهذا أيضًا سبب سهولة تنفيذها اليوم في اثني عشر سطرًا (ماذا تفحص لون).

التبنّي

  • وحّدت شبكات بطاقات الائتمان عليها مع انتشار بطاقات الشريط المغناطيسي في الستينيات والسبعينيات؛ وهي الآن مفروضة بـISO/IEC 7812.
  • تبنّاها معيار GSM لأرقام IMEI في الهواتف.
  • تستخدمها أرقام التأمين الاجتماعي الكندية وأرقام الهوية الإسرائيلية والجنوب أفريقية وأرقام الضرائب اليونانية وكثير من برامج بطاقات الولاء.
  • معرّفات مقدّمي الرعاية الصحية الأمريكية تطبّق لون مع بادئة ثابتة.

لماذا لم تُستبدل أبدًا

وُجدت مخططات أقوى بحلول 1969 (Verhoeff)، لكن لون كانت منقوشة بالفعل على مئات ملايين البطاقات. في المدفوعات، التوافق مع القديم يغلب الأناقة.

المعادلة ملكية عامة؛ انتهت البراءة في 1977. استكشفها تفاعليًا في مختبر لون.

أسئلة شائعة

من اخترع خوارزمية لون؟

هانس بيتر لون، باحث في IBM، قدّم طلب البراءة في 1954 ومُنحت في 1960.

هل خوارزمية لون محمية ببراءة؟

لم تعد كذلك. انتهت براءة 1960 منذ عقود والطريقة ملكية عامة.

Educational content — not legal or financial advice. Open the interactive Check Digit Lab →