# Luhn formula

DevFeed: [Luhn formula](<https://devfeed.tech/articles/luhn-formula-35288.md>)

Original publisher: [Read original article](<https://darkcoding.net/credit-card/luhn-formula/>)

Author: Graham King

Published: 2005-10-23T16:44:52Z

Content type: tutorial

Language: en

Sources: [Graham King](<https://devfeed.tech/sources/graham-king.md>)

Topics: [Algorithm](<https://devfeed.tech/topics/algorithm.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [algorithm](<https://devfeed.tech/tags/algorithm.md>), [code](<https://devfeed.tech/tags/code.md>), [credit-card](<https://devfeed.tech/tags/credit-card.md>), [security](<https://devfeed.tech/tags/security.md>), [validation](<https://devfeed.tech/tags/validation.md>)

## AI overview

This tutorial explains the Luhn formula, also called MOD 10, for calculating and validating the check digit of 13- to 16-digit credit card numbers. It describes how the algorithm detects input errors, provides the calculation steps and code formula, and notes that it is not a security mechanism.

## Source excerpt

Unraveling the mystery behind credit card number validation.