How To Calculate Code 128 Check Digit? A Step-By-Step Guide

Oct 31, 2022 - Views: 1389

Rating: 4.9 - 52Votes

This article will give you the code 128 check digit to help you understand more about it. 

This code type is popular and beneficial for you. 

Thus, you should learn the related information, including how to use it and how to do code 128 barcode check digit calculator. 

Scroll down for details!

Code 128 barcode check digit

Code 128 barcode check digit

Code 128 Specification

Before understanding barcode check digit calculator code 128, we need to know about the barcode first. 

What is barcode? Barcodes are machine-readable representations of letters and numbers composed of bars and spaces.

One of the common barcode types is code 128. 

It is also named because it can encode all 128 ASCII characters and is the symbol of choice for many barcode applications. 

It is considered the most readable barcode with the highest message integrity.

Code 128 specificationCode 128 specification

Code 128 has three character sets in the table below, defined as Code Set A, Code Set B, and Code Set C. 

These codes can be selected by choosing the starting character appropriately. 

A special "shift" character in each code set allows it to be replaced with another during the scanning process. 

Code set C provides twice the packing density of code sets A and B when the data consists only of numeric data. Each code set includes one or more characters stored for special roles and functions.

The Code 128 specification asks for a check digit for inclusion. A barcode symbol structure consists of:

  • Quiet zone or white space to the left of the bar

  • Starting character

  • Variable number of data characters

  • Check digit

  • Stop sign

  • Quiet zone or white area to the right of the bar

The quiet zone may be at least 10 times with the space element and the narrowest bar width. 

Each character in the barcode symbol consists of 6 bars and 6 spaces. 

The last symbol is always one space less than the bar, so the stop character has 6 bars and 5 spaces.

Each bar or space can have one of four different unit widths. 

Therefore, the narrowest possible bar or space is a quarter of the width of the widest bar or space. 

This table contains bar/space widths for the Code 128 character set. Note that the bar width sum for each character is even, and the sum of spaces is odd. 

The first column is the value to calculate the code 128 font check digit in the table. 

The Code 128 specification lets you read information printed anywhere outside the symbol.

Code 128 Character Set

Although the Code 128 character set comprises only 102 characters, this symbology supports all 128 lower-ASCII characters. 

This is possible as Code 128 uses three various sets of 102 characters (Code Set A, Code Set B, and Code Set C). 

The starting character determines the default code set for one of types of barcode such as Code 128. 

Yet, it is possible to switch between different character sets and use a combination of them in a single symbol. 

Code 128 gives the highest possible character density since you encode data. The three character sets may be summarized as follows.

  • Code Set A: Include all numeric characters (0-9), uppercase letters (A-Z), punctuation marks, seven special characters, and "control characters" (ASCII values ​​00-95).

Code 128 character set

Code 128 character set

  • Code Set B: Include all numbers (0-9), uppercase and lowercase letters (A-Z, a-z), punctuation, and 7 special characters (ASCII values ​​32-127).

  • Code Set C: Contain all pairs of digits from 00 to 99 and 3 special characters. Although this code set is numeric only, each character represents two digits.

Instructions On The Use Of START, CODE And SHIFT Characters

To minimize symbol length, you should follow this guide: 

According to the guidelines, the Bars & Stripes Barcode Software automatically selects the correct START, CODE, and SHIFT characters.

  1. From left to right:

(a) Use the leading character 'C' if the data begins with four or more digits; 

(b) Any other case where a control character precedes a lowercase letter you can  use as a font for barcode in the data will use the starting character 'A'. 

(c) Otherwise, use the starting letter 'B'.

  1. Use code ‘A’ or code ‘B’ to insert before the final digit if character ‘C’ is used and a digit odd number begins the data. You can follow guidelines 1(b) and 1(c) above to make an option between code ‘A’ and Code ‘B’.

  2. If 4 or more digits appear together in character sets 'A' or 'B': 

(a) If the number of digits in the group is even, add the code 'C' before the first digit. 

(b) If the number of digits in the group is odd, insert the code 'C' immediately after the group.

Guide on using CODE, START, and SHIFT characters

Guide on using CODE, START, and SHIFT characters

  1. If the data contains character set 'B' and control characters: 

(a) when a control character is followed by a lowercase letter before another control character appears, insert a shift character before the control character. 

(b) otherwise, insert the code 'A' before the control character. 

  1. If the character set shows an 'A' and a lowercase letter in the data: 

(a) After a lowercase letter and before another lowercase letter, there is a control character; it is case-sensitive and adds a shift character before lowercase letters. 

(b) Otherwise, insert the code 'B' in front of lowercase letters with a proper barcode font

  1. If the character set is 'C' and the data has non-numeric characters, insert the code 'A' or choose "B" before non-numeric characters using guidelines 1(b) and 1(c) above. 

How To Calculate Code 128 Check digit?

Does code 128 have a check digit? Code 128 is self-checking and does not normally require a check digit. 

However, a module 103 checksum digit can be added for applications requiring very high accuracy. 

Follow our instructions on code 128 check digit calculation below:

  • Get each symbol character value. 

  • Each symbol character position is weighted. The starting character position is weighted with 1. Then the other positions are weighted by 1, 2, 3, 4, ..., n from the beginning of the left side of the first symbol character. 

  • Multiply each character by the weight of the type of barcodes string. 

  • Sum the products of the check digit calculator for code 128 in step 3. 

  • Next, divide the sum of the products by 103. 6. The remainder value in step 4 is the symbol check character value. Then you need to find the corresponding checksum digit according to the ASCII value. 

Barcode code 128 check digit

Barcode code 128 check digit

Frequently Asked Questions (FAQs)
1. How do I use Code 128?

A Code 128 barcode begins with a START character, followed by a DATA character, a CHECK character, and a STOP character. 

The entire bar code symbology must also include a quiet zone with spaces both before the START character and after the STOP character.

2. What is a GS1-128 number?

Barcode GS1-128 (Data Carrier) was developed to provide a global standard for data exchange between different companies. 

GS1-128 not only encodes data but also provides a way to define the meaning of the data by defining a list of Application Identifiers (AIs).

3. Does Code 128 need an asterisk?

Yes, it does. Code 128 requires different stop characters or starts to complete the barcode’s encoded.

Conclusion

We’ve covered important information about code 128. Follow the ultimate guide with the ideal tips to create the best quality barcode. Besides, you should consider code 128 check digit with special characters and specifications to use and calculate it properly.

Rating: 4.9 - 52Votes

13 Comments

Filter
  1. Axel Moore

    Axel Moore

    This is a copywriting treasure. Thanks for all the guidance and explanations

    Leave a Comment

    Your email address will not be published. Required fields are marked *
    Submit Comment
    1. Barcodelive

      Glad to hear that

      Leave a Comment

      Your email address will not be published. Required fields are marked *
      Submit Comment
  2. Ronan Hamilton

    Ronan Hamilton

    So does Code 39 have a check digit?

    Leave a Comment

    Your email address will not be published. Required fields are marked *
    Submit Comment
    1. Barcodelive

      No, code 39 does not require a checksum or check digit

      Leave a Comment

      Your email address will not be published. Required fields are marked *
      Submit Comment
      1. Ronan Hamilton

        Ronan Hamilton

        Thanks for your reply

        Leave a Comment

        Your email address will not be published. Required fields are marked *
        Submit Comment
  3. Nicole Rogers

    Nicole Rogers

    Fantastic article

    Leave a Comment

    Your email address will not be published. Required fields are marked *
    Submit Comment
    1. Barcodelive

      Sounds good

      Leave a Comment

      Your email address will not be published. Required fields are marked *
      Submit Comment
  4. Kyler Hughes

    Kyler Hughes

    How many digits is a barcode 128?

    Leave a Comment

    Your email address will not be published. Required fields are marked *
    Submit Comment
    1. Barcodelive

      Code 128 includes 108 symbols: 103 data symbols, 3 start symbols, and 2 stop symbols. Each symbol consists of three black bars and three white spaces of varying widths

      Leave a Comment

      Your email address will not be published. Required fields are marked *
      Submit Comment
  5. Connor Anderson

    Connor Anderson

    What symbology does barcode number 5013 7985 use and exactly how is it determined (I know it’s something to do with first and last character)?

    Leave a Comment

    Your email address will not be published. Required fields are marked *
    Submit Comment
    1. Barcodelive

      It is likely an EAN-8 code. 501 would signify the UK, 3798 would be the item reference number, and the final 5 would be a checksum.

      Leave a Comment

      Your email address will not be published. Required fields are marked *
      Submit Comment
  6. Olivia Collins

    Olivia Collins

    How can I tell if a barcode is 128 or 39? I think that these 2 barcodes are quite similar

    Leave a Comment

    Your email address will not be published. Required fields are marked *
    Submit Comment
    1. Barcodelive

      A Code 39 barcode encodes 39 characters in total.
      Code 128 has a higher density than Code 39.
      Code 39 does not include a check digit, while Code 128 does

      Leave a Comment

      Your email address will not be published. Required fields are marked *
      Submit Comment

Leave a Comment

Your email address will not be published. Required fields are marked *
Submit Comment