Card Number Validation Methods: Luhn, BIN & Authorization

Our Cards

Choose from any of our gift cards to give to your loved ones

card number validation system

giftcardimage

Where to Use?

Redeem your gift cards at any of our Merchants

Card Number Validation Tools: What They Check and How to Choose

Where to Buy?

You can purchase a gift card from any of these locations

Card Number Validation Software Buying Guide

ABOUT US

about

What is ONYX GiftCards?

Onyx Gift Cards is a Grenadian company designed to introduce, market and manage gift cards systems in Grenada for retailers and corporations. We are enthusiastic about the effect and influence we will have on the local market. We intend to expand our systems regionally with a range of product offerings and services.

What is a Gift Card?

Gift cards are the preferred way of giving and receiving gifts. They carry a monetary value that can be redeemed for gifts at your favorite store.
Onyx GiftCards are “Open Gift Cards” which means that they can be redeemed at multiple merchant locations. They are standard credit card size, can fit into the average wallet and made of PVC plastic. Onyx GiftCards are Barcoded for security and safety for the consumer and bear a disclaimer at the back.
Onyx Giftcards can be bought with a branded Card backer which is black in colour and is designed to fit the card. There is an area to write a brief message to the recipient as well.

How it Works?

  • Buy an Onyx Gift Card at these local stores
  • Give your gift card to friends, family, co-workers, etc.
  • The recipient can shop at our select merchants nationwide
  • Your friends, family, co-workers, etc. will present their gift card at checkout to pay for your item(s)
  • They will walk away happy with the best gift ever...the gift of Choice

Why ONYX GiftCards?

  • Save TIME. No need to run around looking for the perfect gift
  • Redeem from a variety of business island-wide. We will continue adding businesses as fast as ONYX grows.
  • ONYX Gift Cards do not expire
  • Cards are valued at convinient amounts to meet every need and occasion

Card number validation methods are layered checks that confirm a card number is correctly formatted, passes a mathematical checksum, and falls inside a known issuer range. Format rules, the Luhn algorithm, and BIN lookups only prove that a number looks plausible, while a live authorization from the issuing bank is the only step that confirms the account is open and able to fund a charge.

What each validation layer actually proves

Validation is usually described as a single step, but it is a stack of independent tests. Each one answers a different question, and skipping a layer creates either false rejections or false confidence.

The Luhn algorithm, explained plainly

The Luhn formula, also called the mod-10 checksum, is the most widely used structural test for payment card numbers. It catches typing mistakes, not fraud.

  1. Starting from the rightmost digit and moving left, double the value of every second digit.
  2. If a doubled value is greater than nine, subtract nine from it.
  3. Add all the resulting digits together.
  4. If the total is divisible by ten, the number passes.

A useful property for developers is that roughly one in ten random digit strings will pass a Luhn check by chance. That is why the checksum should be treated as a typo filter in form validation and never as evidence that a card is genuine.

BIN and issuer range lookups

The first six to eight digits of a card number form the issuer identification number, still commonly called the BIN. Payment networks and BIN database providers map those ranges to a card brand, issuing country, card type (credit, debit, prepaid), and sometimes the specific bank.

A BIN lookup can reject a number whose prefix does not exist, flag a mismatch between the stated country and the billing address, or route a transaction to the correct network. BIN tables change as issuers open and retire ranges, so any local copy needs periodic refresh rather than a one-time import.

Prefix and length rules by network

Every major network reserves specific leading digits and accepts a defined set of lengths. Typical patterns include:

These rules are useful for choosing the right input mask and for showing the correct card logo, but they should be coded as configuration rather than hard-coded constants, since networks revise their ranges.

Security codes and address checks are separate

The card verification value, printed on the back or front depending on the network, is validated by the issuer during authorization, not by the merchant's form logic. Address Verification System checks compare the numeric part of the billing street address and the ZIP code with what the issuer holds. Both are risk signals attached to a transaction; neither confirms that a card number itself is valid.

Authorization is the only real proof

An issuer response of approved, declined, or referral reflects the state of the account, available credit, and the issuer's own fraud rules. Testing with a real authorization is the standard way to confirm a card is live, but it also creates a hold on the customer's funds and carries cost, so most systems reserve it for the final checkout step.

Implementation notes

Limits and common pitfalls

A number that passes every structural test can still belong to a closed account, a canceled card, or a range that was never issued. Conversely, a valid card can fail a strict form rule if the input mask does not accept a newer length. Building separate, clearly named functions for each layer makes it easier to see which test rejected an input and to adjust that test alone when network rules change.

Contact Us

Latest

Latest

Unable to help

This request is for guidance on buying stolen credit card data, which I cannot help with.

Read our complete guide: Should You Buy CVV From a Card Shop? The Honest Buyer's Guide