Your cart is empty
Shop now
+

Luhn Check Test: How Card Number Validation Works

Explore

Luhn Check Test: How Card Number Validation Works

We guarantee gift cards direct to your inbox immediately.
Shop Now!

Let's Work Together

Sign up now with Call of Gift Cards and become eligible for benefits including 10% commission on cards bought from us, awesome conversion rates and much more!
Find Out More

Digital Gift Cards

The market for digital goods and services are growing rapidly. One of the true shifts in online behaviour is the switch from traditional direct online payments and purchase to wallets and gift cards. ...read more
+

Digital Gift Cards

The market for digital goods and services are growing rapidly. One of the true shifts in online behaviour is the switch from traditional direct online payments and purchase to wallets and gift cards. We invite you to start your own online business as a partner of ours. By signing up as a partner you’ll get access to one of the largest gift card databases in the world. All you need to focus on is to market your website and products. Gift cards are quickly outperforming traditional gifts, as they give the recipient the choice to pick their own present from a variety of options. The range of e-gift cards available on the Call of Gift Cards's partner sites includes popular categories such as restaurants, games, travel and fashion.

Gift Vouchers

Traditional gift vouchers are printed paper gifts available in set values that can be spent in specific stores. Open-loop, semi-open loop, and closed-loop are often terms used when referring to gift v...read more
+

Gift Vouchers

Traditional gift vouchers are printed paper gifts available in set values that can be spent in specific stores. Open-loop, semi-open loop, and closed-loop are often terms used when referring to gift vouchers. All gift cards sold via our partners’ websites are closed loop. This means that the gift card can only be spent at a single brand location, for example, an Xbox voucher can only be spent at Xbox etc.

Our Gift Cards

Minecraft Coins – Starfield – Alan Wake 2 – Spotify Gift Card – Madden NFL 24 – Mortal Kombat™ 1 – Garena Shells – FIFA 23 – Assassin’s Creed Mirage – Valorant Points – Grand Theft Auto V – Razer Gold Pin – Cabal Online eCoin – Battlenet Gift Card – Elden Ring – Minecraft Java + Bedrock – Call of Duty: Modern Warfare III - Cross-Gen Bundle – EA SPORTS FCTM 24 Standard Edition Xbox One & Xbox Series X|S – Steam Wallet Gift Card – Battlefield™ V Standard Edition – iTunes Gift Card – PlayStation Network PSN Gift Card – Netflix Gift Card – Google Play Gift Card – Amazon Gift Card – Xbox Live Gift Card – Facebook Game Gift Card – FIFA 20 (Xbox One) – Far Cry 5 - Gold Edition (Xbox One) – NieR:Automata Become As Gods Edition (Xbox One) – SONIC FORCES™ Digital Standard Edition (Xbox Game EU) – Apex Legends™ - Octane Edition (Xbox Game EU) – Mario Kart 8 Deluxe (Nintendo) – Fortnite V-Bucks Gift Card – Nintendo eShop Gift Card – Red Dead Redemption 2 (Xbox One) – Halo 5: Guardians (Xbox One) – The Legend of Zelda: Link's Awakening (Nintendo) – DOOM Eternal Standard Edition (Xbox One) – The Legend of Zelda: Breath of the Wild (Nintendo) – Resident Evil 3 (Xbox One) – Need For Speed Heat (Xbox One) – Assassin's Creed Odyssey - Gold Edition (Xbox One) – Cars 3: Driven to Win (Xbox One) – Call of Duty: Modern Warfare 2 Campaign Remastered (Xbox One) – Team Sonic Racing™ (Xbox Game EU) – Project CARS - Game of the Year Edition (Xbox One) – Mario & Sonic Tokyo 2020 (Nintendo) – Tom Clancy’s Ghost Recon Wildlands - Deluxe Edition (Xbox One) – Forza Horizon 4 Ultimate Edition (Xbox One) – Sekiro™: Shadows Die Twice (Xbox One EU) – Tom Clancy's The Division 2 (Xbox One EU) – Gears 5 (Xbox One) – Dragon Ball Z: Kakarot (Xbox One) – The Crew Ultimate Edition (Xbox One) – Ultimate Marvel vs. Capcom 3 (Xbox One) – Pokemon Let's Go Eevee! (Nintendo) – Sonic Mania (Xbox Game EU) – UFC 3 - Deluxe Edition (Xbox One) – Mass Effect Andromeda - Standard Recruit Edition (Xbox One) – BioShock: The Collection (Xbox One) – A Way Out (Xbox One) – Borderlands 3 (Xbox One) – Overcooked! 2 (Nintendo) – World of Warcraft – PUBG Gift Card – Spyro Reignited Trilogy (Xbox One) – Aeria Points Gift Card – Destiny 2: Shadowkeep (Xbox One) – Steep (Xbox One) – Infinite Minigolf (Xbox One) – Rage 2 (Xbox One) – Fire Emblem Warriors (Nintendo) – Anthem (Xbox One) – Kingdom Hearts 3 (Xbox One) – FIFA 19 (Xbox One) – Goat Simulator (Xbox One) – The Elder Scrolls Online (Xbox One) – FOR HONOR™ Standard Edition (Xbox One) – IMVU Prepaid Gift Card

Luhn Check Test: How Card Number Validation Works

A Luhn check test recalculates the final digit of a number sequence and compares the result with the digit already written there. If the two match, the number passes. It is a math checksum rather than a database lookup, so a passing result means the digits are formatted correctly and nothing more. It does not confirm that a card exists, is active, has funds, or belongs to any particular person.

How the Luhn algorithm works

The Luhn algorithm is also called the modulus 10 or mod 10 algorithm. IBM researcher Hans Peter Luhn developed it in the 1950s, and it was later adopted as a standard check digit method for identification numbers. The procedure is short enough to run by hand.

  1. Write the digits in order and find the rightmost digit. That is the check digit.
  2. Moving right to left, double every second digit, starting with the digit immediately left of the check digit.
  3. If a doubled value is 10 or higher, subtract 9 from it. This is the same as adding the two digits of the product together.
  4. Add the check digit and all the transformed digits together.
  5. If the total is a multiple of 10, the number passes. If not, it fails.

A worked example

Consider the sequence 79927398713. From the right, the check digit is 3 and does not get doubled. The digits doubled are the second 9, the 2, the 3, the 8, and the 1.

  • Doubled values: the second 9 becomes 18, the 2 becomes 4, the 3 becomes 6, the 8 becomes 16, and the 1 becomes 2.
  • Reduce anything above 9 by subtracting 9: 18 becomes 9 and 16 becomes 7.
  • Transformed sequence, left to right: 7, 9, 9, 4, 7, 6, 9, 7, 7, 2, 3.
  • Sum: 70. Because 70 divides evenly by 10, the sequence passes the Luhn check test.

Change any single digit in that sequence and the total will no longer be a multiple of 10. That sensitivity is the point of the method.

What a Luhn check test proves and what it does not

It can tell you

  • Whether a string of digits is internally consistent.
  • Whether a single mistyped digit or a swapped pair was likely entered.
  • Whether the length and format match a numbering scheme that uses check digits.

It cannot tell you

  • Whether the number is assigned to a real account.
  • Whether an account is open, closed, frozen, or funded.
  • Whether the number is authorized for any transaction.

Where check digit validation shows up

The method is used in many numbering systems, not just payments. Common examples include payment card numbers, IMEI numbers on mobile devices, Canadian Social Insurance Numbers, National Provider Identifiers in US healthcare, some gift and loyalty card numbers, and internal account numbering schemes at banks and utilities. In each case the check digit guards against clerical errors during data entry, not against fraud.

Running a test on numbers you control

You can validate any number you own with a spreadsheet formula, a short script, or an online validator. The five steps above translate directly into a loop: walk the digits from right to left, double every second one, subtract 9 when needed, and check the total. When you build a test set, use synthetic values rather than real account numbers so that nothing sensitive ends up in logs, screenshots, or shared files.

Legal boundaries around card numbers

Only run a Luhn check test on numbers you own or on clearly synthetic test data. Handling payment card numbers that belong to other people is regulated. PCI DSS requires organizations to protect stored account data, including primary account numbers, and in the United States, producing, selling, or using payment card numbers without authorization is a federal crime. A passing checksum has no bearing on whether a number may lawfully be used, and a format check is never a substitute for authorization.

What's New

Why I Can't Write a CVV Buying Guide

I can't write a buying guide for CVVs or stolen card data. I can help with card-fraud prevention, PCI DSS, and payment-security content instead.

Read our complete guide: What to Know Before You Buy CVV: Prices, Scams, and Legal Risks