Check Digit Calculation Method
Some bar code types and modifiers call for the calculation and presentation of check digits. Check digits are a method of verifying data integrity during the bar coding reading process. Except for UPC Version E, the check digit is always presented in the bar code bar and space patterns, but is not always presented in the HRI. The following table shows the check digit calculation methods for each bar code type and the presence or absence of the check digit in the HRI.
Bar Code Type | Modifier | In HRI? | Check Digit Calculation |
---|---|---|---|
1 – Code 39 (3-of-9 Code), AIM USS-39 | X'02' | Yes | Modulo 43 of the sum of the data characters' numerical values as described in a Code 39 specification. The start and stop codes are not included in the calculation. |
2 – MSI (modified Plessey code) | X'02' - X'09' | No | IBM® Modulus 10 check
digit:
|
IBM Modulus 11 check
digit:
|
|||
NCR Modulus 11 check digit:
|
|||
3 – UPC/CGPC Version A | X'00' | Yes | UPC/EAN check digit calculation:
|
5 – UPC/CGPC Version E | X'00' | Yes | See UPC/CGPC Version A |
8 – EAN 8 (includes JAN-short) | X'00' | Yes | See UPC/CGPC Version A |
9 – EAN 13 (includes JAN-standard) | X'00' | Yes | See UPC/CGPC Version A |
10 – Industrial 2-of-5 | X'02' | Yes | See UPC/CGPC Version A |
11 – Matrix 2-of-5 | X'02' | Yes | See UPC/CGPC Version A |
12 – Interleaved 2-of-5 | X'02' | Yes | See UPC/CGPC Version A |
13 – Codabar, 2-of-7, AIM USS-Codabar | X'02' | No | Codabar check digit calculation:
|
17 – Code 128, AIM USS-128 | X'02' | No | Code 128 check digit calculation:
|
24 – POSTNET | X'00' - X'04' | NA | The POSTNET check digit is (10 - (sum modulo 10)) modulo 10, where sum is the sum of the ZIP code data. |
26 – RM4SCC | X'00' | NA | The RM4SCC checksum digit is calculated by using an algorithm that weights each of the 4 bars within a character in relation to its position within the character. |
X'01' | NA | None. | |
27 – Japan Postal Bar Code JPOSTAL | X'00' | N/A |
The Japan Postal Bar Code check digit calculation: Convert each character in the bar code data into decimal numbers. Numeric characters are converted to decimal. Each hyphen character is converted to the number 10. Each alphabetic character is converted to two numbers according to the symbology definition. For example, A becomes 11 and 0, B becomes 11 and 1,…, J becomes 11 and 9, K becomes 12 and 0, L becomes 12 and 1, …, T becomes 12 and 9, U becomes 13 and 0, V becomes 13 and 1, …, and Z becomes 13 and 5. Sum the resulting decimal numbers and calculate the remainder modulo 19. The check digit is 19 minus the remainder. |
X'01' | N/A | None | |
28 – DataMatrix (2DMATRIX) | X'00' | N/A | The DataMatrix symbology uses a Reed-Solomon error checking and correcting algorithm. |
29 – MaxiCode 2DMAXI | X'00' | N/A | The MaxiCode symbology uses a Reed-Solomon error checking and correcting algorithm. |
30 – PDF417 | X'00' - X'01' | N/A | The PDF417 symbology uses a Reed-Solomon error checking and correcting algorithm. |
31 – Australia Post Bar Code APOSTAL | X'01' - X'08' | No | The Australian Post Bar Code uses a Reed Solomon error correction code based on Galois Field 64. |
32 — QR Code | X'02' | NA | The QR Code symbology uses a Reed-Solomon Error Checking and Correcting (ECC) algorithm. |
33 — Code 93 | X'00' | No | Both check digits (C and K) are calculated as Modulo 47 of the sum of the products of the data-character numerical values as described in the Code 93 specification and a weighting sequence. The start and stop codes are not included in the calculation. |
34 — USPS Four-State | X'00' - X'03' | No | No check digit exists, but error detection and correction is added as part of the encoding process. See Specifications for the Four-State Barcode. |