Barcode Scanning 101: How to Decode Code39 and Code128?

Wanna understand how a barcode recognition SDK or software interprets a barcode? We’ve worked out an infographic to get you started. You might also be interested in learning how to decode 2D barcodes.

To decode information from Code39, Code128 and other linear bar codes, there are generally two steps: location and decoding.

Step 1. Location

First, a barcode SDK scans the entire width of an image trying to identify whether there are bar code candidates.
It searches for black/white patterns.

At the end of this step, the barcode API has Regions of Interest detected.

Step 2. Decoding

In this step, the barcode scanning SDK tries to understand the encoded information.

  1. Count and compare image pixels
  2. Match start and end identifiers
  3. Interpret patterns between the start and end identifiers based on that code type’s specifications
Barcode scanning 101

Barcode reading 101

Subscribe Newsletter

Subscribe to our mailing list to get the monthly update.