Corporate17 July 2026

What Is a Barcode? Structure, Meaning and Common Types

An introduction to barcodes, how an EAN-13 code is structured, what its digits mean, and the main barcode types used in retail and logistics.

Lawyer Do Khanh Linh — Director, LTV Law
Reviewed by Lawyer Do Khanh Linh — Director, Hanoi Bar Association
Updated 17 July 2026
What Is a Barcode? Structure, Meaning and Common Types
Table of contents

A barcode is an image made up of alternating parallel bars and spaces, encoded according to set rules so that a scanner can read it. It is the machine-readable version of the identification number printed underneath. Barcodes are everywhere, from the black and white bars on a carton of milk or a bottle of water to the labels on cartons in a warehouse and containers at a port. With one short beep of a scanner, the product's name, price, origin and stock level are identified accurately in less than a second.

This guide explains what a barcode is and how it differs from the number it carries, the history of the barcode, how barcodes are structured and read, the main one-dimensional and two-dimensional types, how to read an EAN-13 code and calculate its check digit, what the country prefix means, and how barcodes are used in practice. It is background knowledge that any business placing products on the Vietnamese market, including foreign brand owners and importers, should have before registering barcodes in Vietnam.

Quick answers

How does a barcode number differ from the barcode itself?

The number is for people, as a string of identifying digits, while the barcode is for machines, as an image of bars that a scanner reads. Both express the same identifying content.

Who manages and issues barcodes in Vietnam?

The National Committee for Standards, Metrology and Quality, under the Ministry of Science and Technology, issues and manages barcode numbers through the National Barcode Centre, known as GS1 Vietnam, under Decree No. 37/2026/ND-CP. Globally, GS1 coordinates barcode numbering in more than 100 countries.

What types of barcode are there?

There are one-dimensional barcodes, such as EAN, UPC and Code 128, and two-dimensional barcodes, such as the QR Code. They differ in how much data they can store.

What a barcode is, and how it differs from the barcode number

In Vietnam the two concepts are often combined into a single phrase meaning "barcode number and barcode", but they are two different components of the same identification system:

  • The number is a string of digits printed below the bars, used to identify the product, the company and the country of registration. It is human-readable, and each item is assigned a number that is unique worldwide.
  • The barcode is an image of bars, thick and thin, long and short, and parallel spaces, arranged according to an encoding rule so that a scanner can read it. In other words, the barcode is the machine-readable version of the number.

Put simply, the number is for people and the barcode is for machines, and both express the same identifying content. When a scanner reads the bars, it decodes the same digits printed underneath and then checks them against a database to retrieve the related information, such as the product name, price, manufacturer and expiry date.

A short history of the barcode

The idea of the barcode emerged in the late 1940s in the United States, when two students, Norman Joseph Woodland and Bernard Silver, looked for a way to automate supermarket checkouts. The first patent for barcode technology was granted in 1952, based on encoding information in concentric circles, a "bull's-eye" design inspired by Morse code.

It was not until the early 1970s, when laser and computer technology had matured, that barcodes were commercialised. The key milestone came on 26 June 1974, when a pack of Wrigley chewing gum became the first product in the world to be scanned at a checkout, in the state of Ohio in the United States, using the UPC (Universal Product Code) standard. From there, barcodes spread throughout retail worldwide.

Today, the management and allocation of barcode numbers worldwide is coordinated by GS1, with member organisations in more than 100 countries. In Vietnam, the National Committee for Standards, Metrology and Quality (Ministry of Science and Technology) is the sole member of GS1 and issues barcode numbers through the National Barcode Centre (GS1 Vietnam).

Barcode structure and how a scanner reads it

Basic structure

A typical linear (1D) barcode consists of:

  • Quiet zones: blank spaces at both ends of the barcode that help the scanner find the start and end.
  • Start and stop characters: special bars indicating the reading direction and the type of code.
  • Data area: the sequence of bars and spaces that encodes the actual digits or characters.
  • Check digit: the final digit, used to verify the validity of the whole sequence.
  • Human-readable digits: the numbers printed below the bars.

How a scanner reads a barcode

The core principle is light reflection: black bars absorb light and white spaces reflect it strongly. The process is:

  1. A light source, a red laser or an LED, shines on the barcode.
  2. An optical sensor in the scanner captures the reflected light. Black bars give a weak signal and white spaces a strong one.
  3. A decoder converts the light and dark signals, according to their widths, into a binary sequence of 0s and 1s and then translates this into the corresponding digits or characters.
  4. The sequence is sent to software, such as a point-of-sale or warehouse management system, which checks it against a database and displays the information.

For 2D codes such as the QR Code, the scanner uses a camera to capture the whole matrix of squares and processes it with image algorithms. This allows the code to be read from any direction, even when it is blurred or partly torn.

Types of barcode

Barcodes fall into two broad groups: 1D (one-dimensional) barcodes and 2D (two-dimensional) barcodes.

1D (linear) barcodes

1D codes consist of vertical parallel bars and encode data horizontally. Their capacity is limited, usually to a few dozen characters, but they are simple, cheap and the most common type in retail.

  • EAN-13: 13 digits; the most common standard in Vietnam, Europe and most of the world for identifying retail products. It is printed on most consumer goods.
  • EAN-8: a shortened 8-digit version for products with small packaging, such as sweets and mini cosmetics, where there is no room for an EAN-13.
  • UPC-A: 12 digits; the main standard in the United States and Canada, compatible with EAN-13.
  • UPC-E: a compressed 6-digit version of UPC-A for small packaging in the North American market.
  • Code 39: encodes letters and numbers and is widely used in industry, defence and asset management. Its drawback is the length of the code.
  • Code 128: encodes all 128 ASCII characters, with high capacity and good compression; common in logistics, shipping and supply chain management.
  • ITF (Interleaved 2 of 5): encodes digits only and prints durably; often used on cartons and pallets in warehousing.

2D (matrix) barcodes

2D codes store data both horizontally and vertically in a matrix of squares, giving them many times the capacity of 1D codes. They can hold thousands of characters, including text, URLs and encoded images.

  • QR Code (Quick Response): the most common matrix code; read quickly from any direction and used for electronic payments, marketing, traceability and sharing links. It has strong error correction and can still be read when partly damaged.
  • Data Matrix: a compact matrix that stores a lot of data in a very small area; used to mark electronic components, medical devices and surgical instruments.
  • PDF417: a stacked 2D code with high capacity, used for driving licences, tickets, files and identity documents.

Comparison of common barcode types

TypeGroupData encodedCapacityMain uses
EAN-131D13 digitsLowGlobal retail, consumer goods
EAN-81D8 digitsVery lowProducts with small packaging
UPC-A1D12 digitsLowRetail in the United States and Canada
UPC-E1D6 digitsVery lowSmall packaging in North America
Code 391DLetters and numbersMediumIndustry, defence
Code 1281D128 ASCII charactersHigh for a 1D codeLogistics, supply chain
ITF1DDigitsMediumCartons, pallets, warehouses
QR Code2DNumbers, letters, URLs, binary dataVery highPayments, marketing, traceability
Data Matrix2DNumbers, lettersHighComponents, medical devices
PDF4172DNumbers, letters, binary dataVery highDocuments, tickets, identity files

Structure of an EAN-13 code and how to read it

Because EAN-13 is the most common type in Vietnam, understanding its structure helps you "decode" a product's origin. The 13 digits of an EAN-13 code are divided into four groups:

  1. Group 1, country prefix (first 3 digits): allocated by GS1 to each country or territory. For example, 893 is Vietnam.
  2. Group 2, company number: allocated by the national GS1 organisation to each company; its length varies with the size of the company.
  3. Group 3, product (item) number: assigned by the company itself to each of its items.
  4. Group 4, check digit (last digit): used to verify the validity of the whole code.

Note: the lengths of the company number and product number are not fixed. A company with many items is given a shorter company number, leaving more room for product numbers, and vice versa.

What the first three digits mean

The first three digits show the country where the number was registered. This is where the code was registered, which is not necessarily where the product was made. Some typical prefixes are:

  • 893: Vietnam
  • 690 to 699: China
  • 880: South Korea
  • 885: Thailand
  • 899: Indonesia
  • 00 to 13: United States and Canada

For the full list, see our list of country barcode prefixes and our detailed article on the 893 barcode prefix for Vietnam.

How to calculate the EAN-13 check digit

The check digit, the 13th digit, is calculated from the first 12 digits using a weighting of 1 and 3. The steps are:

  1. Add the digits in the odd positions (positions 1, 3, 5, 7, 9 and 11).
  2. Add the digits in the even positions (positions 2, 4, 6, 8, 10 and 12), then multiply that total by 3.
  3. Add the results of steps 1 and 2.
  4. Divide the total by 10 to find the remainder. If the remainder is 0, the check digit is 0; otherwise, the check digit is 10 minus the remainder.

Example: take the first 12 digits 893850797611:

  • Sum of odd positions: 8 plus 3 plus 5 plus 7 plus 7 plus 1 equals 31.
  • Sum of even positions: 9 plus 8 plus 0 plus 9 plus 6 plus 1 equals 33; multiplied by 3, this gives 99.
  • Total: 31 plus 99 equals 130.
  • 130 divided by 10 leaves a remainder of 0, so the check digit is 0.

The complete EAN-13 code is therefore 8938507976110. Because of the check digit, if even one digit is misread, the scanner detects the error immediately and reports it instead of identifying the wrong product. The same calculation can be used by consumers to screen suspicious codes; see our guide on how to check whether a barcode is genuine.

Benefits of barcodes

For businesses

  • Speed and accuracy: scanning is many times faster than manual entry and almost eliminates human error.
  • Efficient stock and sales management: stock levels and sales are updated automatically, with out-of-stock alerts in real time.
  • Professionalism and market access: GS1 barcodes are required for goods to enter supermarkets, retail chains and export markets.
  • Fighting counterfeits and imitations: combining barcodes with traceability systems helps verify origin.
  • Lower operating costs: fewer staff are needed for counting, and losses are reduced.

For consumers

  • Quick checks of a product's origin through the first three digits and scanning apps.
  • Fast checkout and transparent prices.
  • Greater confidence in the quality and authenticity of goods.

Practical uses of barcodes

  • Retail: scanning at the checkout for payment and for managing prices and promotions.
  • Warehousing and logistics: tracking goods from receipt through dispatch and transport, and controlling pallets and cartons with Code 128 and ITF. In import and export, barcodes also support customs declaration and clearance; see our article on the customs declaration barcode sheet.
  • Traceability: attaching a code, usually a QR Code, so that consumers can look up the product's journey from farm or factory to the consumer.
  • Healthcare: managing medicines, specimens, equipment and patient records, reducing dangerous mix-ups.

Barcodes, QR Codes and traceability labels compared

These three concepts are often confused. They can be distinguished as follows:

  • 1D barcodes such as EAN-13: identify the product, have small capacity and mainly serve checkout and stock management. The code itself contains only an identification number.
  • QR Code: a type of 2D barcode with large capacity that can hold a link or text, common in payments and marketing. The QR Code is a tool and can be used to create traceability labels.
  • Traceability label: an overall solution, usually a printed QR Code, sometimes with an anti-counterfeiting label, linking to a database that stores the product's whole journey. A traceability label is not a separate type of barcode but an application of barcodes or QR Codes linked to a data platform.

Frequently asked questions

Are the barcode number and the barcode the same thing?

No. The number is the string of digits people can read, while the barcode is the image of bars that machines read, and both express the same product identification.

Does the 893 prefix mean the goods were made in Vietnam?

Not necessarily. 893 means the number was registered by a company in Vietnam through GS1 Vietnam, and the product may have been manufactured elsewhere while being owned by a Vietnamese company that registered the code.

Can a business create its own barcodes?

You can create internal codes for use in your own warehouse, but to sell in the market, in supermarkets or for export, you must register valid numbers with GS1 to ensure they are unique worldwide.

Can one barcode be used for several products?

No. Each item, and each different pack size, must have its own number to avoid duplication and confusion.

Will QR Codes completely replace 1D barcodes?

Not yet. QR Codes are strong in capacity and traceability, but 1D codes such as EAN-13 remain the required standard for retail checkout and compatibility with point-of-sale systems worldwide, and many products use both.

How much does it cost to register and maintain barcodes?

Costs consist of an initial registration fee and an annual maintenance fee, depending on the size of the business and the number of products; see our article on GS1 barcode registration and annual maintenance fees.

What are the steps to register barcodes?

From 1 July 2026, a business files its application online on the National Public Service Portal using a VNeID account, pays the numbering fee and is granted the right to use barcode numbers in electronic form within 7 working days of a complete and valid application, under Decree No. 37/2026/ND-CP; the detailed process is explained in our full guide to registering a GS1 barcode.

How LTV Law helps

A barcode is not just a set of black and white bars but part of a globally standardised identification system that helps businesses manage goods accurately and transparently. If your business needs GS1 barcode numbers in Vietnam, LTV Law advises on the right code format, prepares the application and handles the procedure from start to finish; see our barcode registration service.

To get started, contact our team.

This article is for general information only and does not constitute legal advice.

barcode basicsEAN-13GS1

Need help protecting your rights in Vietnam?

LTV Law acts as your licensed local representative — from filing to enforcement.

ZALOCALL