The Comprehensive Guide to 1D and 2D Barcodes

The Comprehensive Guide to 1D and 2D Barcodes

With so many 1D and 2D barcode types, how do you choose the right one?

In this article, we give you a comprehensive guide to 1D and 2D barcodes, covering 18 major barcodes types. Collectively, they cover the bulk of application needs.

For 1D barcodes, they include:

For 2D barcodes, they include:

Postal Codes

There are many more barcode types than these 24 barcodes, but these 24 barcodes are pretty much the most popular ones. This guide will introduce what each one of these 24 barcodes provides and what’s the best scenario to use them. Also, you may want to check out the interactive barcode compare page.

Try Dynamsoft online demo

1D and 2D Barcodes

There are the two major barcode types:

  • 1D barcodes —1D barcodes, or one-dimensional barcodes are linear barcodes. They consist of vertical lines of varying widths with specific gaps resulting in a particular pattern.
  • 2D barcodes —2D barcodes, or two-dimensional barcodes, are more complex. They encode data generally in square or rectangular patterns of two dimensions.

In general, 2D barcodes can represent more data per unit area than 1D barcodes. More often than not they support a bigger character set than 1D barcodes. Also, the 2D barcodes are relatively new barcode types and need support from more complex scanning devices.

Choosing the Right Barcode Types

One main factor for choosing a barcode is based on what type of information you need to encode into it. This is also known as the barcode character set. With a clear idea about what type of information you are going to encode, the barcode selection will be much easier.

What information can a barcode include?

There are generally four different types of character sets:

  • Numeric ⁠— includes numbers only (0-9)
  • Alpha-numeric ⁠— includes numbers and alphabetic characters (0-9 and A-Z)
  • GS1 AI encodable character set 82 ⁠— includes numbers (0-9), alphabetic characters (A-Z), and special characters (refer to page 471 of the standard)
  • Full ASCII ⁠— includes any ASCII character (value 0-127)

By supported character sets, 1D and 2D barcodes can be categorized into four different groups, as the table below shows (Patch Codes do not contain any encoded data):

Character Set 1D Barcode 2D Barcode Postal Code
Numeric UPC-A, UPC-E, EAN 13, EAN 8, Industrial 2 of 5, Interleaved 2 of 5, Codebar[1], Code 11[2], MSI Code, GS1 Databar (Omnidirectional, Stacked Omnidirectional, Truncated, Stacked, Limited)   USPS Intelligent Mail, Postnet, Planet
Alpha-numeric Code 39, Code 93[3]   Australian Post, UK Royal Mail
GS1 AI encodable character set 82 GS1 Databar (Expanded, Expanded Stacked) GS1 Composite Code  
Full ASCII Code 128 QR Code, Data Matrix, PDF417, MaxiCode, Aztec Code  

[1] Codabar also supports these characters: Colon (:), Slash mark (/), Period (.), Plus sign (+)

[2] Code 11 also supports character: Hyphen (-)

[3] Code 39 and Code 93 also support these characters: Percent sign (%), Plus sign (+), Dollar sign ($), Slash mark (/), Period (.), Hyphen (-)

In summary, 1D barcodes usually encode a string of numeric such as product number, production date, type, size, and so on. If you want to add text information into the 1D barcodes, Code 39, Code 93 and Code 128 help a lot. QR code and other 2D barcodes store large amounts of data, which allows for more flexible usage. Another advantage of the 2D barcodes is that they can encode images, which can be read by the smartphone’s camera.

It’s important to note if your information contains only numeric characters, you can still choose barcodes that support alpha-numeric or ASCII character sets. You may need more physical space to store the data, but you will have more flexibility. You will be able to accommodate more types of information in the future without changing the type of barcode used.

Barcode Symbologies

UPC-A

What is it?

The UPC-A barcode was created by IBM in 1971. Nowadays it’s found on virtually every consumer goods packaging. This includes on the shelves of your local supermarket, as well as books, magazines, and newspapers.

UPC-A encodes 11 digits of product information data along with a trailing check digit, for a total of 12 digits of barcode data. The 11 product digits are further divided into three logical categories.

  • The first digit represents the information regarding the type of the product.
  • The next five digits contain information about the manufacturer of the product.
  • The last five digits contain information about the particular product being encoded.

An example of a typical UPC-A barcode is:

UPC-A

Where is it used?

The UPC-A barcode is widely used all over the world for scanning of trade items at the point of sale.

Industry

  • Retail
  • Warehousing

UPC-E

What is it?

The UPC-E is a variation of the UPC-A which allows for a more compact barcode by compressing out unnecessary zeros. This helps result in the UPC-E barcode being only about half the size of a UPC-A barcode. So, the UPC-E can generally be used in a very small space where a full UPC-A barcode couldn’t reasonably fit.

UPC-A

Original UPC-A Barcode:

Equivalent UPC-E Barcode:

UPC-A

As UPC barcodes, UPC-A and UPC-E contain only numerals. So, they should be used on simple and retail stores product that generally do not require complex information encoding.

Where is it used?

The UPC-E barcode is used in retail and warehousing, especially in the USA and Canada.

Industry

  • Retail
  • Warehousing

EAN 8

What is it?

An EAN-8 barcode is derived from the longer European Article Number (EAN-13) code. The main purpose of the EAN-8 barcode is to use as little space as possible.

An EAN-8 barcode includes a two or three-digit country code, four of five data digits (according to the length of the country code), and a checksum digit. The data digits in an EAN-8 symbol identify a specific product and manufacturer.

EAN-8

EAN-8 is encoded using the three EAN-13 character sets and also has a check digit that is calculated in the same manner as EAN-13. There is a limited number of EAN-8 barcodes available in each country. So, they are issued only for products with insufficient space for an EAN-13 symbol.

Where is it used?

You’ll find EAN-8 barcodes on products where only limited space is available, like small candies, cigarettes, pencils, and chewing gum packets.

Companies may also use EAN-8 barcodes to encode RCN-8s (8-digit Restricted Circulation Numbers) used to identify own-brand products sold only in their stores.

Industry

  • Retail

EAN 13

What is it?

The International Article Numbering Association (EAN) in Europe designed the EAN-13 barcode type. Most European countries are using this barcode type.

EAN-13 is a 13-digit (12 data and one check) barcoding standard which is a superset of the original 12-digit Universal Product Code (UPC) system. Therefore, any software or hardware capable of reading an EAN-13 symbol should automatically be able to read an UPC-A symbol.

The 13 digits in the EAN-13 barcode are grouped as follows:

  • 2 or 3 digits for number system or country code
  • 5 or 4 digits for manufacturer (company) code or prefix
  • 5 digits for product code
  • 1 digit for checksum

A typical EAN-13 barcode looks something like this:

EAN-13

Since 2005, all retail scanning systems in the USA have accepted the EAN-13 symbol as well as the standard UPC-A. So, it is recommended that all new designs implement EAN-13 rather than UPC-A. This will make your software/hardware appealing to the international community. It also eliminates the need for manufacturers who export goods to the US and Canada to double-label their products.

Where is it used?

The EAN-13 barcode is used worldwide for marking products often sold at retail stores and point of sales.

Industry

  • Retail

Industrial 2 of 5

What is it?

Industrial 2 of 5 is a low-density numeric symbol that has been with us since the 1960s. The barcode is called “2 of 5” due to the fact that digits are encoded with five bars, two of which are always wide (and the remaining three are narrow).

Industrial 2 of 5 is a very simple symbol in that all information is encoded in the width of the bars. The spaces in the barcode exist only to separate the bars themselves.

A typical Industrial 2 of 5 barcode looks like this:

Industrial 2 of 5

Where is it used?

Industrial 2 of 5 has been used in photofinishing, transport and warehouse sorting applications, as well as for sequentially numbering airline tickets.

Industry

  • Transport
  • Warehousing

Interleaved 2 of 5

What is it?

Interleaved 2 of 5 is a higher-density numeric symbol based upon the Industrial 2 of 5 symbol. It’s a more efficient implementation of Industrial 2 of 5. Interleaved 2 of 5 allows information to be encoded in both the bars and spaces, whereas (as previously explained) Industrial 2 of 5 only encodes information in the width of the bars.

Each data character consists of five elements, either five bars or five spaces. Of these five elements, two are wide and three are narrow. The symbol is termed “interleaved” because the first numeric data is encoded in the first five bars while the second numeric data is encoded in the first five spaces that separate the first five bars. Thus the first five bars and spaces actually encode two characters. This feature allows Interleaved 2 of 5 to achieve a relatively higher density, but users must always encode an even number of numeric values.

A typical Interleaved 2 of 5 barcode appears like this:

Interleaved 2 of 5

Note that the above barcode is physically smaller than Industrial 2 of 5.

Industrial 2 of 5

Where is it used?

Interleaved 2 of 5 is used primarily in applications such as label packaging, distribution and warehousing. Since the barcode can deal with high printing tolerances, it is good for printing on corrugated cardboard.

Industry

  • Packaging
  • Logistics

Codabar

What is it?

Codabar was developed in 1972 by Pitney Bowes, Inc. It and its variants are also referred to as Codeabar, Ames Code, NW-7, Monarch, Code 2 of 7, Rationalized Codabar, ANSI/AIM BC3-1995 or USD-4.

Codabar is a discrete, self-checking symbol that encodes up to 16 different characters with an additional four start/stop characters. Codabar can encode the digits zero through nine, six symbols (-:.$/+), and the start/stop characters A, B, C, D, E, *, N, or T. The start/stop characters must be used in matching pairs and may not appear elsewhere in the barcode. Since Codabar is self-checking, there is no established checksum digit.

A typical Codabar barcode looks like this:

Codabar

Although newer symbologies hold more data information in a smaller space, Codabar has a large installed base in libraries.

Where is it used?

Codabar barcodes are used by logistics and healthcare professionals, including U.S. blood banks, FedEx airbills, photo labs, libraries, etc.

Industry

  • Logistics
  • Healthcare
  • Education

Code 11

What is it?

Code 11, also referred to as USD-8, is a high-density discrete symbol produced by Intermec in 1977.

Code 11

The symbology is numeric-only and is able to encode the numbers zero through nine, the dash symbol (-), and start/stop characters. One or two modulo-11 check digit(s) can be included. A typical Code 11 barcode appears as such:

Each digit is made up of three bars and two spaces. The width of a digit will not be fixed. Of these five elements, there could be two wide and three narrow, or one wide and four narrow.

Code 11 is not immune to printing imperfections because they can easily convert one character into another valid character. So one, or sometimes two, check digits (named C and K) are used to improve data integrity; often if the length of the data is 10 characters or fewer, only the first check digit (C) will be used.

Where is it used?

It is used primarily in labeling telecommunications equipment.

Industry

  • Telecommunications

Code 39

What is it?

As the first alpha-numeric symbol developed in the year 1974 by Intermec, Code 39 is a variable length, discrete barcode symbology. Also, it is often known as Alpha39, Code 3 of 9, Code 3/9, Type 39, USS Code 39, or USD-3.

The name of code 39 comes from the fact that it could only encode 39 characters in total. However, in its most recent version, the character set has been increased to 43. They consist of uppercase letters (A through Z), numeric digits (zero through nine) and a number of special characters (-, ., $, /, +, %, and space). An additional character (denoted ‘*’) is used for both start and stop delimiters. A typical Code 39 barcode appears as such:

Code 39

The barcode itself does not include a check digit. But it is considered self-checking in that a single print defect cannot transpose one character into another valid character.

Code 39 is general-purpose and one of the most widely used barcode types. It can be encoded and decoded by almost every barcode encoding/decoding equipment.

There are some drawbacks with Code 39. It has a low data density. It’s also not as compact as, for example, the Code 93 or Code 128 barcodes. That makes it not suitable for very small goods or items that require large amounts of information to be encoded.

Where is it used?

Born in 1974, Code 39 is still widely used, especially in non-retail environments. It is supposedly the standard barcode used by the United States Department of Defense and is also used by the Health Industry Bar Code Council (HIBCC).

Industry

  • Government
  • Manufacturing
  • Logistics
  • Postal
  • Medical
  • Automotive
  • Defense

Code 93

What is it?

Code 93 was made in 1982 by Intermec to complement and improve upon Code 39.

Code 93 is similar to Code 39 in that it can represent an alpha-numeric character set by using combinations of two characters. It differs in that Code 93 is a continuous symbol and produces denser code. It encodes 47 characters compared to Code 39’s 43 characters. Its high density and compact size make its labels around 25 per cent shorter than barcodes produced in Code 39.

Each Code 93 character is nine modules wide, and always has three bars and three spaces. A common Code 93 barcode looks like this:

Code 93

The Standard Mode (default implementation) of Code 93 can encode uppercase letters (A through Z), digits (zero through nine) and special characters like the *, -, $, %, (space), ., /, and + . The Full ASCII mode or extended version can encode all 128 ASCII characters. Code 93 enables additional security within the barcode itself.

Where is it used?

Code 93 barcodes are widely used in logistics to identify packages, in retail inventory, label electronic components, and reportedly even provide additional delivery information for the Canadian Post.

Industry

  • Postal
  • Retail
  • Manufacturing
  • Logistics

Code 128

What is it?

Computer Identics, in 1981, designed Code 128, which is another linear barcode popular in industry and stores.

The Code 128 character set includes the digits zero through nine, the letters A-Z (upper and lower case), and all standard ASCII symbols and control codes. The codes are separated into three subsets A, B, and C. There are three separate start codes to indicate which subset will be used. In addition, each subset includes control characters to switch to another subset in the middle of a barcode. Subset A includes the standard ASCII symbols, digits, upper case letters, and control codes. Subset B includes standard ASCII symbols, digits, upper and lower case letters. Subset C compresses two numeric digits (the set of 100 digit pairs from 00 to 99) into each character, providing excellent density.

An example barcode of alphanumeric encoding in a single Code 128 barcode is:

Code 128

Code 128 is usually selected over Code 39 in new applications because of its excellent density and a much larger selection of characters. It has been widely implemented in many applications where a relatively large amount of data has to be encoded in a very small space.

Where is it used?

Code 128 barcodes are compact, high-density codes used in logistics and transportation industries for ordering and distribution. They’re geared toward non-POS products, like supply chain applications needing label units with serial shipping container codes (SSCC).

Industry

  • Transport
  • Shipping
  • Tracking

DataBar

What is it?

DataBar is a family of linear symbologies used within the GS1 system barcodes. There are three types of GS1 DataBar symbols and seven DataBar variations.

For more information about all the different variations, please visit our DataBar introduction.

DataBar

Where is it used?

DataBar barcodes are typically found in grocery stores on fresh produce labels.

Industry

  • Retail

MSI Code

What is it?

MSI Code is a variant of the Plessey Code, also known as Modified Plessey. The MSI Data Corporation developed the MSI Code to improve the decoding accuracy of the Plessey Code, which is one of the most error-prone barcodes.

A MSI Code only contains digits from 0 to 9. There are four possible check digit calculation algorithms for error detection:

  • Modulo 10 
  • Modulo 11
  • Modulo 1010 
  • Modulo 1110

By default, a Modulo 10 check digit is verified.

A typical MSI Code looks like this:

MSI Code

Where is it used?

MSI Codes are used in inventory management to mark shelves and containers to identify storage locations.

Industry

  • Inventory
  • Warehousing

QR code

What is it?

The QR code is a type of matrix barcode that can encode a wide variety of data types, including numeric, alphabets, special characters and binary data as well. These are the ones you see nowadays with a series of black and white cells rather than the more familiar black lines or bars. They really rose in popularity with mobile devices. It was initially developed by Toyota subsidiary Denso in September 1994. It’s currently defined by the International Organization for Standardization(ISO)/The International Electrotechnical Commission (IEC) 18004.

The QR code was designed to allow high-speed component scanning. A charge-coupled device (CCD) barcode reader can decode up to 30 QR codes per second with up to 100 characters in each barcode.

The QR code has full (360 degrees) reading features. Each QR code has three finder patterns located in three corners of the QR code. A CCD reading device can detect and decode the position of the barcode, the size of the barcode and the size of the inclination angle.

This barcode type has a high data density. It can encode 1,817 Chinese characters, 7,089 numbers or 4,296 English letters. It has four levels of error correction. Even if a QR code is damaged or broken, it can often still be read correctly.

A common QR code appears like such:

QR code

Where is it used?

Today, QR codes have become common in areas such as consumer advertising, code payments, website logins, for data encryption, and more.

Industry

  • Retail
  • Entertainment
  • Advertising

PDF417

What is it?

The PDF417 barcode is a type of stacked linear barcode. Symbol Technologies was said to have developed this barcode type back in 1991. Today, it is represented by ISO standard 15438.

Each PDF417 barcode consists of three to 90 rows, and a single row is essentially the equivalent of a small 1D barcode. PDF417 specifies that each pattern in the code consists of four bars and spaces, and each pattern is to be 17 units long. This is how we get the “417” part of the name.

A common PDF417 barcode looks like this:

PDF417

Where is it used?

The PDF417 barcode type is mainly used in transportation, identification cards and inventory management. Most states in America use PDF417 to encode drivers’ key information on the back side of driver licenses.

Industry

  • Transport
  • Logistics
  • Warehousing
  • Government

Data Matrix

What is it?

Data Matrix barcode is also a two-dimensional matrix barcode. It first came about in 1994, and today, it is represented by the standard ISO/IEC 16022. The Data Matrix barcode supports advanced encoding error checking and correction algorithms. This allows the recognition of barcodes that are up to 60 percent damaged. So, it’s commonly used on items where barcodes get easily damaged due to high heat, chemical exposure, etc. As a result, Data Matrix barcodes are used in electrical rating plates, surgical instruments, circuit boards and the like.

Data Matrix barcodes are adaptable in size. The symbol size can be as small as 2.5mm, which is the smallest among all 2D barcodes. Meanwhile, the size and the encoded data capacity is independent. This allows the choosing of a lot of different matrix sizes.

A common Data Matrix barcode can appear like this:

Data Matrix

Where is it used?

The most popular application for Data Matrix is labelling small items, such as small electronic components and pill bottles.

Industry

  • Electronics
  • Retail
  • Government
  • Marketing
  • Post
  • Electronics
  • Medical

GS1 Composite Code

What is it?

The GS1 Composite symbology integrates both a GS1 system linear symbol and a 2D Composite Component as a single symbology. The 2D Composite Component is printed above the linear component. The two components are separated by a separator pattern.

For more information about all the different variations, please visit our GS1 Composite introduction.

A common GS1 Composite code can appear like this:

gs1 composite barcode Dynamsoft

Where is it used?

GS1 Composite barcodes are typically found in grocery stores on fresh produce labels.

Industry

  • Retail

MaxiCode

What is it?
MaxiCode is a two-dimensional code developed by United Parcel Service (UPS). It’s suitable for tracking and managing shipments of packages. It uses dots arranged in a hexagonal grid with concentric circles in the center. MaxiCode symbols include a number of encoded messages such as:

  • Purchase order number
  • Customer reference
  • Invoice number
  • Tracking number
  • Indicator of the originating carrier

A common MaxiCode can appear like this:

maxicode barcode Dynamsoft

Where is it used?

MaxiCode is mostly used on shipping labels for addressing and sorting US domestic and international packages.

Industry

  • Postal

Aztec Code

What is it?

Aztec codes use less space than other matrix barcodes due to its lack of a quiet zone, and is therefore ideal in scenarios where space is limited.

Aztec codes are published as ISO/IEC 24778:2008 standard.

Aztec code dynamsoft

Where is it used?

  • Aztec codes are a type of 2D barcode used in transport ticketing, (i.e. railways and airplane boarding passes).

Industry

  • Transportation
  • Government
  • Commercial

Conclusion

In general, the selection of a barcode relies on many factors. Some of these are listed below. But, of course, this is not an all-inclusive list:

  1. You need to consider the industry and related regulation needs and requirements. Make sure to follow common practices.
  2. Be clear about the character set you need to support for the business.
  3. If possible, always choose more compatible barcode types, like EAN-13 over UPC-A.
  4. If you need to encode a large amount of data, consider a 2D barcode first.
  5. Check if there is some special need for your product. Is the product too compact in space that allows only for high-density barcodes like Code 11, Code 128, etc.? Will your product packaging get easily polluted requiring a barcode with good fault tolerance? If so, consider barcodes with an error correction mechanism, like QR Code, Data Matrix, PDF417, etc. You can compare two or more barcode types on this page and learn the differences between barcodes.
  6. Do you need your barcodes read by mobile apps? If so, the QR Code is extremely popular in this scenario.

Take the Next Step

After choosing a barcode type, you can download Dynamsoft’s Barcode Reader to read the information encoded in your barcode. Dynamsoft’s Barcode Reader supports reading all major 1D and 2D barcodes, using only a few lines of code to implement it.

A series on different types of barcodes

If you’d like to compare other barcode types, please check out our online barcode comparison tool.