What are the different types of barcodes?

How do you choose the best barcode type for your application?

What is the difference between a QR code and a DataMatrix code? Why does white space matter in barcode design? How are a barcode, a scanner and the X-dimension connected? When creating your own barcodes, three elements are essential: the barcode symbology (type), the X-dimension and the white space. Our specialists explain everything you need to know, so read on.

1: Barcode symbology (type)

Simply put, barcode symbology refers to the type of barcode you choose. It determines how the lines, blocks and spaces are interpreted by scanners. You have a choice of various barcode types. These include different linear barcodes, also known as 1D codes, such as Code 128, Code 39 and Interleaved 2 of 5. In addition, there are 2D codes, including QR codes and DataMatrix codes. Selecting the right barcode symbology improves scanning speed and accuracy. Below, we outline the most commonly used barcodes for both logistics and industrial labelling.

Datamatrix code

The difference between code 39 and code 128

Code 39 Code 128
Type Linear (1D) barcode Linear (1D) barcode
Characters Alphanumeric (A–Z and 0–9) with a limited set of special characters Supports the complete ASCII character set
Applications
  • Product identification
  • Track & trace
  • Inventory management
  • Distribution
  • Shipping
  • Warehouse rack labels
  • Pharmaceutical labels
  • Laboratory labels
  • LPN labels
  • Pallet ID labels
Features 9 elements per character (5 bars, 4 spaces) 6 elements per character (3 bars, 3 spaces)
Additional information
  • Maximum of 43 characters, therefore limited data capacity
  • Encoding is always enclosed by start/stop characters (*)
  • Less efficient in terms of space for longer strings or special characters
  • Industry standard for warehouse labels
  • Designed for robust printing, enabling greater scanning distances and improved scanning accuracy and speed
  • Space-efficient as two characters can be encoded within one character set

Code 128 variant: GS1

GS1 developed the global standard for barcodes across retail and supply chain operations. The GS1 barcode is based on Code 128 and is used for product identification at the point of sale in the consumer goods sector, as well as for tracking pallets and goods in logistics processes.

GTIN or UPC

Two variants of the GTIN code (formerly EAN) are widely used worldwide on consumer goods, both online and in-store: GTIN-8 and GTIN-13. Pick up almost any product from the shelf and you will find this particular barcode printed on it.

SSCC

The Serial Shipping Container Code (SSCC) is used in the logistics sector for accurate tracking of each shipping unit (box, crate, parcel or pallet). The code becomes obsolete once the shipment reaches its final destination.

Interleaved 2 of 5

Interleaved 2 of 5 (ITF) is commonly used in retail for outer packaging (ITF-14). This barcode supports only numeric data and requires an even number of digits. If an odd number is entered, a leading zero is automatically added.

GS1 DataMatrix

GS1 DataMatrix is the standard 2D code for the identification of pharmaceutical products. It can store a large amount of data in a compact space, making it ideal for small product packaging such as medicines.

DataMatrix code

A DataMatrix code is a 2D code made up of black and white squares, also known as modules or cells, arranged in a grid pattern. It is recognisable by the solid L-shaped border, the finder pattern, along the left and bottom edges, which allows scanners to recognise it as a DataMatrix code. This type of barcode supports alphanumeric data and can store over 3,000 characters.

When selecting a DataMatrix code, keep in mind that the height-to-width ratio is fixed. This limits how much the code can be resized and directly impacts the dimensions of the label on which it is printed.

Why use a DataMatrix code?

  • Suitable for applications with limited space for an identification label, for example on small components, printed circuit boards (PCBs) and smartphone batteries.
  • A DataMatrix code offers a higher data density than a traditional, linear barcode, allowing more information to be stored within a small area.
  • Data can be replicated within the code, which means the code can still be read by a scanner even when up to 40% of it is damaged.
  • Compared to a QR code, a DataMatrix code can typically be read from a greater scanning distance.

QR-code

Next to the traditional linear barcode, the QR code is one of the most widely recognised barcodes worldwide. QR stands for “Quick Response”, referring to the speed at which the code can be scanned. It is characterised by its square shape, featuring large square markers (finder patterns) in three corners and a smaller square (alignment pattern) in the bottom-right-hand corner.

A QR code can contain up to 7,089 characters. In the case of text-based content, this includes all letters, punctuation and spaces. Originally used mainly for marketing purposes in the consumer market, QR codes are now increasingly used on industrial labels, for example on electronic components, type plates, for product identification, as well as in laboratories and the pharmaceutical industry.

Within warehousing and logistics, QR codes are also gaining popularity, for example on LPN labels, magnetic shelf labels and rack labels. Similar to DataMatrix codes, the height-to-width ratio of a QR code remains fixed when resizing, which directly affects the label size.

Why use a QR code?

  • Ideal for marketing, communication and promotional purposes, such as links to websites, documents, event tickets, text messages with or without a URL, contact details (digital business cards), phone numbers, calendar entries or geographic locations on Google Maps.
  • No dedicated scanning equipment is required. Most modern smartphone cameras support QR scanning as standard, whereas another commonly used 2D code, the DataMatrix code, typically requires a specialised app.

What is the difference between a linear barcode and a QR code?

Linear barcode

A traditional barcode is a 1D, linear code. From distribution centres to supermarkets, this type of barcode is widely used and remains the most common on labels. Key benefits include:

Adjustable dimensions
Compatible with all scanners

QR code

Companies using image scanners increasingly choose 2D barcode labels, such as QR codes or DataMatrix codes. Compared to traditional linear barcodes (1D), these 2D codes offer several advantages:

Scanning distance
Label design

2: X-dimension

What does the X-dimension mean?

The second key factor that determines the size of a barcode is the X-dimension. In a linear barcode, the X-dimension represents the width of the smallest bar. In a 2D code, it refers to the height and width of a single square (module).

The X-dimension is defined by the brand and type of scanner, as well as the scanning distance at which the barcode needs to be read. In industry terminology, the X-dimension is also referred to as the “mil size”, since it is measured in thousandths of an inch, known as a mil.

Why is the X-dimension important?

The X-dimension directly affects the maximum distance from which a scanner can read a barcode accurately and quickly. The higher the mil value, the wider the bars, and the greater the scanning distance.

It is therefore important to first identify the type of scanner you use or intend to use – short range, mid range or long range – before choosing a type of barcode and starting the design process. For applications involving greater scanning distances, we recommend using retro-reflective label material. This significantly increases scanning distance and performance.

How to identify the X-dimension?

When designing barcodes with label software such as Loftware NiceLabel, you can define the X-dimension yourself. First, you need to establish the required scanning distance. Your scanner manual will list the X-dimension specifications. These will help you select the correct X-dimension and determine the appropriate label size.

To illustrate this, see the example below of mil sizes for a long-range scanner, similar to those used at ONE2ID. For example, when using Code 128 with a 5 mil X-dimension, the maximum distance at which the scanner can reliably read the barcode is approximately 17 centimetres.

Scanner make and model: Zebra DS3600-SR Ultra-Rugged Scanner
Barcode Mil size Min. scanning distance (cm) Max. scanning distance (cm)
Code 128 5 3,3 17
Code 128 20 7,1 71,1
Code 128 40 4,4 152,4
DataMatrix 7,5 4,8 15,2
DataMatrix 10 3,5 21,8

Test your barcode scanners

If you want to determine the maximum scanning distance of your scanners, you can request our free test sheet. It features different barcode types in various sizes, helping you identify which barcode size and symbology deliver the best performance with your scanners.

3: Quiet zone (white space)

The third and final element influencing barcode dimensions is the quiet zone, or white space. When designing a barcode, always allow for sufficient white space on either side of the barcode. Barcode scanners rely on this clear area to properly detect and read the code, so no text or graphics should be placed within this space.

If the quiet zone is insufficient or missing entirely, the scanner will require more time to process the barcode, resulting in slower and less efficient scanning. This applies to both linear barcodes (1D) and QR and DataMatrix codes (2D).