Barcodes are all around us. While barcode scanners are the standard tools for reading and decoding barcodes, it is also possible to interpret them manually.
Learning how to read barcodes without a scanner can be helpful for troubleshooting, educational purposes, or when you need to verify product information manually.
This guide explains the basics of barcodes and provides steps for interpreting the information encoded within them.
Types of Barcodes
Barcodes be categorised into two main types: 1D (one-dimensional) and 2D (two-dimensional) barcodes.
1D Barcodes
1D barcodes, also known as linear barcodes, consist of a series of vertical lines and spaces of varying widths. These barcodes are read horizontally from left to right by a barcode reader. They can encode alphanumeric characters only.
Examples of 1D barcodes include:
- UPC (Universal Product Code): Often used in the United States for retail products.
- EAN (European Article Number): Similar to a UPC code but used internationally.
- Code 39: Used for various labelling purposes, including inventory and industrial applications.
- Code 128: Commonly used in shipping and packaging industries.
- Interleaved 2 of 5: Often used in warehouse and industrial applications.
2D Barcodes
2D barcodes use patterns of squares, dots, or other shapes to encode data horizontally and vertically. They can store various data types, such as alphanumeric characters, binary data, and special symbols.
Common examples of 2D barcodes include:
- QR Code (Quick Response Codes): Often used for marketing, linking to websites, and storing contact information.
- Data Matrix: Used in manufacturing industries to track parts and products.
- Aztec Code: Used in applications like ID cards and inventory management.
- PDF417: Often used in transportation tickets and mobile boarding passes.
- MaxiCode: Used by shipping companies for tracking packages.
Understanding Barcode Structure
To manually decode a barcode, it’s essential to understand its basic structure. Barcodes encode information through a combination of bars (black lines) and spaces (white gaps) of varying widths and patterns.
Elements of a 1D Barcode
1D barcodes consist of several key components:
- Quiet Zone: The margin space at the beginning and end of a barcode, that allows scanners to identify the barcode accurately.
- Start and Stop Patterns: Special sequences of bars and spaces that indicate where the barcode begins and ends.
- Data Characters: The main body of the barcode that encodes the actual information. Each character is represented by a unique pattern of bars and spaces.
- Check Digit: A single digit at the end of the barcode which is used to verify the accuracy of the scanned data.
How 1D Barcodes Encode Information?
1D barcodes encode information using a combination of black and white lines representing binary data, where dark lines are treated as 1s and white spaces are treated as 0s.
Each digit in the entire barcode is represented by seven equal-sized vertical blocks. These blocks ensure that each digit occupies the same horizontal space within the barcode.
Here’s how each number from 0 to 9 is represented in a barcode:
- Digit 0: 0001101 (three white spaces, two black lines, one white space, one black line)
- Digit 1: 0011001 (two white spaces, two black lines, one white space, one black line, one white space)
- Digit 2: 0010011 (two white spaces, one black line, one white space, two black lines, one white space)
- Digit 3: 0111101 (one white space, four black lines, one white space, one black line)
- Digit 4: 0100111 (one white space, one black line, two white spaces, three black lines)
- Digit 5: 0110001 (one white space, two black lines, two white spaces, one black line, one white space)
- Digit 6: 0101111 (one white space, one black line, three white spaces, two black lines)
- Digit 7: 0111011 (one white space, three black lines, one white space, one black line, one white space)
- Digit 8: 0110111 (one white space, two black lines, one white space, two black lines, one white space)
- Digit 9: 0001011 (three white spaces, one black line, one white space, two black lines)
Alphabets, special characters, and other data sets are also easily convertible to binary form. They are represented in the same manner as numerical digits in barcodes. Each character is assigned a binary pattern corresponding to a unique sequence of black and white lines.
Interpreting Barcode Information
Interpreting a barcode correctly involves understanding how the encoded data translates into readable information. Follow these steps to manually decode a linear barcode.
Step 1 - Identify the Barcode Type
Barcodes can be visually identified by looking at their structure and pattern.
Determine if the barcode image is a UPC barcode, EAN barcode, Code 39, or another type of 1D barcode. This will help you understand the encoding patterns specific to that barcode type.
Refer to our article, “Identifying Barcode Types Visually,” to learn the skill of identifying barcodes visually.
Step 2 - Understand the Structure
Familiarise yourself with the start, middle, and stop patterns. These patterns are unique sequences of bars and spaces that signal the beginning, middle (for some barcodes), and end of the barcode.
The typical structure includes.
- Start Pattern: Codes begin with the sequence 101
- Middle Pattern: Exactly in the middle of the barcode with the sequence 01010.
- Stop Pattern: The end of the barcode mirrors the start pattern with the sequence 101
Step 3 - Read the Barcode Digit by Digit
Each digit is represented by a specific pattern of black and white lines. Use the reference patterns (as provided in the previous section) to match and decode each set of seven blocks.
Example: Decoding a UPC Bar Code
Let’s walk through an example of decoding a UPC-A barcode commonly found on retail products.
Step 1: Identify the Barcode Visually
A UPC-A barcode consists of 12 numeric digits grouped into a 1-5-5-1 format. This means the barcode starts with a single digit, followed by two groups of five digits each, and ends with a single digit.
The barcode is divided into three sections by sets of longer parallel lines at the beginning, middle, and end.
Step 2: Identify the Start Pattern
The start pattern for a UPC-A barcode is a sequence of three bars represented as 101. This pattern indicates the beginning of the barcode.
Step 3: Identify the Four Widths of the Bars
Each vertical bar in the barcode can have one of four different widths. These widths are classified from thinnest to thickest as 1, 2, 3, or 4.
To decode the barcode, you need to identify the width of each bar. Using a magnifying glass can help distinguish between similar widths.
Step 4: Decode the Left Side Digits
Start by examining the bars on the left side, between the start pattern and the middle pattern. Measure the thickness of each bar, starting with the first white bar.
Each digit is encoded using a specific pattern of four bars. Note the thickness of each bar and group them into sets of four.
For example, if the first white bar after the start pattern is the thinnest, note it as 1. If the following black bar is the thinnest, note it as 1. If the next white bar is the third thickest, note it as 3; if the following black bar is the second thickest, note it as 2. You would write down “1132”.
Continue this process until you have six groups.
Step 5: Decode the Right Side Digits
Next, decode the bars on the right side, starting with the first black bar after the middle pattern. Measure and note the thickness of each bar, grouping them into sets of four.
This side uses an inverse pattern compared to the left side. Therefore, each group will start with a black bar.
Continue until you have another six groups.
Step 6: Decode the Bar Widths into Actual Numbers
Translate the measured bar widths into digits using a specific pattern code. Here’s the code for converting bar widths into numbers:
- 3211 = 0
- 2221 = 1
- 2122 = 2
- 1411 = 3
- 1132 = 4
- 1231 = 5
- 1114 = 6
- 1312 = 7
- 1213 = 8
- 3112 = 9
Step 7: Calculate the Check Digit
The final digit in the UPC-A barcode is the check digit, which is used to verify the accuracy of the barcode. To calculate it.
- Add all the digits in the odd positions (1st, 3rd, 5th, 7th, 9th, and 11th).
- Multiply the sum by 3.
- Add all the digits in the even positions (2nd, 4th, 6th, 8th, 10th).
- Add the results of steps 2 and 3.
- Find the modulus 10 of the total (i.e., the last digit of the sum). If this digit is 0, then the check digit is 0. If it’s any other number, subtract it from 10 to get the check digit.
For example, if the result of step 4 is 16, the check digit will be 10 – 6 = 4. This should match the 12th digit of the barcode.
Conclusion
Understanding how to read a barcode without a barcode scanner is a valuable skill that can be useful in various situations. Learning to identify barcode types, decode their structures, and interpret the encoded data provides insights into the information stored within these ubiquitous symbols.
Whether you are troubleshooting bar code errors, verifying product details, or simply expanding your technical knowledge, the ability to read bar codes without scanning technology is both practical and informative.