Home

LUHN

The Luhn algorithm, also known as the Luhn check or LUHN formula, is a simple checksum used to validate identification numbers such as credit card numbers and IMEI identifiers. It was developed by IBM scientist Hans Peter Luhn in 1954 and has since become a widely adopted method for detecting basic input errors in numeric identifiers.

The validation process proceeds as follows: take the number as written, and starting from the rightmost digit,

Applications and limitations: The Luhn check is widely used to validate credit card numbers and is also

move
left
and
double
every
second
digit.
If
doubling
yields
a
number
greater
than
9,
subtract
9
from
it
(equivalently,
sum
the
digits
of
the
doubled
value).
Sum
all
the
resulting
digits,
including
the
digits
that
were
not
doubled.
If
the
total
is
a
multiple
of
10,
the
number
passes
the
Luhn
check;
otherwise,
it
fails.
employed
for
other
identifiers
such
as
IMEI
numbers
and
some
national
IDs.
It
is
effective
at
catching
many
common
input
errors,
such
as
single-digit
mistakes
and
many
adjacent
transpositions.
However,
it
is
not
a
secure
or
cryptographic
method
and
does
not
protect
against
fraud
or
tampering.
Numbers
can
be
constructed
to
pass
the
check,
so
the
algorithm
should
be
viewed
as
a
practical
error-detection
tool
rather
than
a
security
feature.