Cognex Mobile Barcode Scanner SDK
Code 25

What is Code 25?

Code 25 (also called Code 2 of 5) is a linear or one-dimensional (1D) barcode. This means the barcode is composed of a single set of varying-width vertical lines (black) and spaces (white). The data in the barcode is represented linearly by these black/white patterns (also called bars/spaces). Code 25 is a numeric symbology: it can only be used to represent the digits 0 through 9.

There are actually two Code 25 symbologies: Code 25 Industrial and Code 25 Interleaved. Both symbologies use two-width encoding (narrow bars/spaces and wide bars/spaces, with the wide width being 2 to 3 times the narrow width). Each data character consists of 5 bars/spaces, 2 of which are always wide (hence the name, 2 of 5).


Code 25 Industrial

Code 25 Industrial (also known as Code 2 of 5) only encodes data in the bars of each symbol, using narrow spaces between each bar. Here is an example barcode:




Code 25 Industrial is further characterized as a discrete barcode; each data character in the barcode is separated from the next with an inter-character gap (a single narrow space). This inter-character gap does not represent any data.

Like most other one-dimensional barcodes, Code 25 uses unique start and stop characters. However, Code 25 does not include a check digit and is not self-checking (meaning, a single read/scan error can result in incorrect decoding). For this reason, some users of Code 25 Industrial implement their own check-digit as part of the data encoding. Here is the example again, diagramed for clarity:





Code 25 Interleaved

Code 25 Interleaved (also known as Code 2 of 5 Interleaved, Interleaved 2 or 5, or ITF) is a variant of Code 25 Industrial that stores data in pairs, with 5 bars representing one digit, and the 5 spaces interleaved within the bars representing the second digit. Thus, every 10 bar/spaces represent two digits (as compared to Code 25 Industrial, where every 10 bar/spaces represent a single digit). This limits Code 25 Interleaved to storing an even number of digits, but it is much more compact than Code 25 Industrial. When storing an odd number of digits, a leading zero is typically added, though some implementations use 5 narrow spaces as the last digit (which strictly speaking is not a valid 2 of 5 symbol since it does not include two wide modules). Here is the example from above, including a leading zero so there is an even number of digits:




In contrast to Code 25 Industrial, Code 25 Interleaved is a continuous barcode symbology; there is no inter-character space between adjacent data characters and the space between characters is part of the data representation.

Code 25 Interleaved uses unique start and stop characters, but does not include a check digit. However, Code 25 Interleaved is self-checking (meaning, a single read/scan error will not result in incorrect decoding). Many users of Code 25 Interleaved still implement a check digit for added security and reliability. Here is the example again, diagramed for clarity:




Why use Code 25?

Since Code 25 can only represent numeric digits, its uses are limited. The lack of a standardized check digit and its relatively low-density further limit the barcode. Code 25 Industrial was used initially in the logistics industry, primarily on the cartons of some products (though it has since been displaced by Code 25 Interleaved).

With its higher data density and self-checking symbology, Code 25 Interleaved is used more commonly.

Who uses Code 25?

Code 25 (Interleaved in particular) is still in use today in several industries:

  • The GS1 ITF-14 standard uses Code 25 Interleaved for carton labeling, where the cartons contain products which in turn are typically labeled with UPC or EAN barcodes.
  • 135 film (35mm) canisters use a Code 25 Interleaved barcode which is scanned by many film-processing machines when the canister is inserted for development.
  • Deutsche Post (DHL) uses two variants of Code 25 Interleaved: Identcode and Leitcode.

How do we help developers using Code 25?

The Cognex Mobile Barcode Scanner SDK supports Code 25 detection, enabling developers to gather relevant workflow and application data into their barcode scanning apps. You can download the SDK for free by registering on the Cognex Mobile Barcode Developer Network. In addition, the Barcode Scanner SDK supports a broad range of symbologies to meet your growing development needs.

Get Started