ArtsAutosBooksBusinessEducationEntertainmentFamilyFashionFoodGamesGenderHealthHolidaysHomeHubPagesPersonal FinancePetsPoliticsReligionSportsTechnologyTravel

Test Credit Card Numbers:Significance of Last Four Digits of Credit Card.

Updated on November 8, 2014

Should you share Last Four Digits of Credit Card?

How safe is to give out Last Four Digits of Credit Card?
How safe is to give out Last Four Digits of Credit Card? | Source

How to test credit card numbers for validity

In order to test credit card numbers for their validity we can use a simple check-sum formula namely “modulus 10" or "mod 10" algorithm, which is widely used to validate a variety of identification numbers including credit card numbers. Before I go to explain this validating system it is necessary to explain what actually each digit of 16 digit credit card number means.

The 16 digits imprinted on your credit card may look like a haphazard string of numbers that’s only one of its kinds in the world. But in actual those digits disclose a little more than what you think. All the different credit cards in circulation from the major card issuers have one common thing in them which is the meaning of the numbers on the card. Most of the cards of the major credit card companies have 16 digits on them and each of these numbers has a particular meaning. Retailers may sometimes ask their customers for the last four digits of credit card for typing in the digits on the customer receipts. Whether disclosure of the last four digits of your card has any security risk or not can be understood once you know what the numbers mean.

Structure of the numbers on a 16 digit credit card

Here are what the digits of the 16 digit credit card number stand for:

1st Digit (stands for Industry ID).

1&2- Airline cards; 3- Travel and Entertainment cards; 4&5-Banking and Financial cards; 6-Merchandising and Banking cards; 7- Petroleum cards; 8- Telecom cards; 9- Miscellaneous cards;

2nd to 6th Digit (stands for issuer ID)

Indicates the name of the bank that issued the cards;

7th to 15th Digit (stands for Account ID)

This unique nine digit number identifies your account number;

16th Digit (stands for card check digit)

The final digit of the 16 digit credit card number is the check digit, which is a security number used to detect keying or scanning errors when the series of digits of credit card are entered into a computer.

Significance of the Check Digit

The last of the 16 digits of the credit card number is called the check digit. This check digit is generated from adding the remaining 15 numbers and making some simple calculations on this sum to reduce it down to a number between 0 and 9, which becomes the last digit of the 16 digit credit card. This check digit is a security measure to detect counterfeit card numbers.

How to test credit card numbers for validity

All common credit cards use a check digit algorithm called ‘Modulo 10’ to increase reading or scanning reliability. This eliminates well over 99% of errors. In applications requiring very high data integrity, a check digit is recommended. There is a mathematical association between the numbers on the card and if the numbers are entered incorrectly the card validating system would show error for incorrect number entry.

“Modulus 10" or "mod 10" algorithm, is a simple check-sum formula used to validate a variety of identification numbers, such as credit card numbers and many government identification numbers by distinguishing valid numbers from mistyped or otherwise incorrect numbers. In this validating system, in order to test credit card numbers, every alternate number starting with the first number, is doubled. The doubled numbers are then added to all the other remaining digits of the card, considering all the numbers as individual digits, including the two digit numbers arrived from the doubling operation. The rightmost digit is the check digit and is included in this sum. If the summation of the numbers is a multiple of 10, then the 16 digit credit card number is considered valid otherwise it’s not a valid card.

The following illustration will help you to understand more about the validating system of your credit card:

Take any credit card number: 4417 1234 5678 9113

Double every alternate digit starting from the first

Doubled results: 8 2 2 6 10 14 18 2

Add these new digits to the remaining numbers

Remaining numbers: 4 7 2 4 6 8 1 3

Sum: 8+4+2+7+2+2+6+4+1+0+6+1+4+8+1+8+1+2+3(check digit)

= 70 (Multiple of ‘10’)

The given credit card number is a valid one.

Sharing last four digits of credit.

Let us now come to a frequently sked question whether it is safe to give out the last four digits of credit card to anyone when asked for. Some retailers may like to have a look at your card for manual typing in the last four digits of your card. This is sometimes used by the retailers to verify that you are the right customer. These four digits also help to authenticate that the number programmed to the magnetic stripe on the back of the card that store magnetically encoded data is the same number as imprinted on the card. This is one way of checking fake or reprogrammed cards before allowing the goods to leave the store. However, it is not something for which you really should worry about because even if one knows the last four digits but has no other information about the credit card and the cardholder, he can't reconstruct the entire card number. It is a fact that by sharing the last four digits you are giving out the ‘Check Digit’ of the 16 digit credit card number, but this will not allow one to determine any other digits on your card. After all the check digit is only one number and for each such digit value there are an unspecified large number of possible credit card numbers.


Now that you know how to test credit card numbers using “modulus 10" algorithm, you can use the same formula for checking whether a given credit card number is valid or not. Further, from the discussion above it would be evident that it is practically impossible to guess the 16 digit credit card number in its entirety for any given customer, given only the last four digits. These 4 digits are almost useless to anyone trying to access your account provided that is all the information he has got. You are, therefore, not at all at risk of any identity theft by sharing the last four digits of your credit card with your retailers. Nevertheless, your credit card number is an important piece of personal information from the point of your privacy and to prevent fraud and hence needs to be kept secure. One way to do that is to make it sure that the card numbers are truncated and full credit card numbers are not printed on customer receipts.


    0 of 8192 characters used
    Post Comment
    • profile image


      4 years ago

      Is there cause for concern if they know the last 4 digits of your credit card number, your name, and what you purchased with the card and how much it costs?

    • radharenu profile imageAUTHOR


      6 years ago from India

      Hi Hackslap

      Thanks for your comments.

    • Hackslap profile image


      6 years ago from Sydney, Australia

      Brilliant!! .. I work within the cards industry myself and am aware of some algorithms that are used when assigning a card# but didn't know it so much detail .. voted up mate! ..

    • radharenu profile imageAUTHOR


      6 years ago from India

      Hi Joe

      Thanks for your comment.

    • joedolphin88 profile image


      6 years ago from north miami FL

      It is scary how many things we access with just those 4 numbers. great hub.

    • profile image


      7 years ago

      great article \o/.. Is it safe to give first12 digits of cc number? i mean to ask can anyone determine the last 4 digits if first 12 digits r known?

    • radharenu profile imageAUTHOR


      7 years ago from India

      Hi Joy

      Thank you for stopping by and your comments.

    • joym7 profile image


      7 years ago from United States

      Great hub.. we didn't know that what one can do with our last 4 numbers of credit card. we always share it freely.

      Thank you for this hub. useful for me.


    This website uses cookies

    As a user in the EEA, your approval is needed on a few things. To provide a better website experience, uses cookies (and other similar technologies) and may collect, process, and share personal data. Please choose which areas of our service you consent to our doing so.

    For more information on managing or withdrawing consents and how we handle data, visit our Privacy Policy at:

    Show Details
    HubPages Device IDThis is used to identify particular browsers or devices when the access the service, and is used for security reasons.
    LoginThis is necessary to sign in to the HubPages Service.
    Google RecaptchaThis is used to prevent bots and spam. (Privacy Policy)
    AkismetThis is used to detect comment spam. (Privacy Policy)
    HubPages Google AnalyticsThis is used to provide data on traffic to our website, all personally identifyable data is anonymized. (Privacy Policy)
    HubPages Traffic PixelThis is used to collect data on traffic to articles and other pages on our site. Unless you are signed in to a HubPages account, all personally identifiable information is anonymized.
    Amazon Web ServicesThis is a cloud services platform that we used to host our service. (Privacy Policy)
    CloudflareThis is a cloud CDN service that we use to efficiently deliver files required for our service to operate such as javascript, cascading style sheets, images, and videos. (Privacy Policy)
    Google Hosted LibrariesJavascript software libraries such as jQuery are loaded at endpoints on the or domains, for performance and efficiency reasons. (Privacy Policy)
    Google Custom SearchThis is feature allows you to search the site. (Privacy Policy)
    Google MapsSome articles have Google Maps embedded in them. (Privacy Policy)
    Google ChartsThis is used to display charts and graphs on articles and the author center. (Privacy Policy)
    Google AdSense Host APIThis service allows you to sign up for or associate a Google AdSense account with HubPages, so that you can earn money from ads on your articles. No data is shared unless you engage with this feature. (Privacy Policy)
    Google YouTubeSome articles have YouTube videos embedded in them. (Privacy Policy)
    VimeoSome articles have Vimeo videos embedded in them. (Privacy Policy)
    PaypalThis is used for a registered author who enrolls in the HubPages Earnings program and requests to be paid via PayPal. No data is shared with Paypal unless you engage with this feature. (Privacy Policy)
    Facebook LoginYou can use this to streamline signing up for, or signing in to your Hubpages account. No data is shared with Facebook unless you engage with this feature. (Privacy Policy)
    MavenThis supports the Maven widget and search functionality. (Privacy Policy)
    Google AdSenseThis is an ad network. (Privacy Policy)
    Google DoubleClickGoogle provides ad serving technology and runs an ad network. (Privacy Policy)
    Index ExchangeThis is an ad network. (Privacy Policy)
    SovrnThis is an ad network. (Privacy Policy)
    Facebook AdsThis is an ad network. (Privacy Policy)
    Amazon Unified Ad MarketplaceThis is an ad network. (Privacy Policy)
    AppNexusThis is an ad network. (Privacy Policy)
    OpenxThis is an ad network. (Privacy Policy)
    Rubicon ProjectThis is an ad network. (Privacy Policy)
    TripleLiftThis is an ad network. (Privacy Policy)
    Say MediaWe partner with Say Media to deliver ad campaigns on our sites. (Privacy Policy)
    Remarketing PixelsWe may use remarketing pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to advertise the HubPages Service to people that have visited our sites.
    Conversion Tracking PixelsWe may use conversion tracking pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to identify when an advertisement has successfully resulted in the desired action, such as signing up for the HubPages Service or publishing an article on the HubPages Service.
    Author Google AnalyticsThis is used to provide traffic data and reports to the authors of articles on the HubPages Service. (Privacy Policy)
    ComscoreComScore is a media measurement and analytics company providing marketing data and analytics to enterprises, media and advertising agencies, and publishers. Non-consent will result in ComScore only processing obfuscated personal data. (Privacy Policy)
    Amazon Tracking PixelSome articles display amazon products as part of the Amazon Affiliate program, this pixel provides traffic statistics for those products (Privacy Policy)
    ClickscoThis is a data management platform studying reader behavior (Privacy Policy)