What Is a Barcode? Types, Examples and Uses

A barcode is a machine-readable pattern that represents data. See how its bars, spaces and encoded value work together, then choose the next step for your product or inventory workflow.

A STOCK-4827 reference encoded in a Code 128 with clear quiet zones, read by a scanner, then matched to its stock record in a separate database

What is a barcode?

A barcode is a pattern made for machines: a scanner or a camera app reads it and returns a value, such as a product number or an internal reference. The pattern is drawn as bars and spaces, or as a grid of small squares.

In most uses, the barcode carries an identifier, not the facts about the item. The product name, price or stock level usually comes from the software that looks the value up: a checkout, an inventory tool or a catalogue. Some formats carry more, such as the lot and expiration date fields of GS1-128 or the website link of a QR code.

Barcode examples: what each format encodes

Open a format to see its real symbol, encoded value and reading requirements. Explore internal references, retail product numbers, logistics fields, books and a two-dimensional parts reference.

Code 128 symbol encoding STOCK-4827
STOCK-4827

Encoded value — STOCK-4827 is an internal stock reference chosen by the business. It is not an assigned retail product number.

Bars and spaces — Their widths form the Code 128 pattern. The format includes start, stop and check information that helps a reader recognise and validate the symbol.

Quiet zones — The blank margin at each end separates the symbol from nearby text or graphics. Keep both margins clear when placing the artwork.

Scanner result — A compatible scanner returns STOCK-4827. Product names, prices and stock levels come from the receiving software’s records, not from this symbol.

Code 128 Barcode Generator

Code 39 symbol showing the demonstration value ASSET-2048
ASSET-2048

Encoded value — ASSET-2048 is an internal equipment reference. Code 39 supports uppercase letters, digits, spaces and selected punctuation.

How it reads — A compatible Code 39 reader returns ASSET-2048. The start and stop patterns frame the value; the generator adds them, so you do not type asterisks around the reference.

Use it correctly — Match the reference to your asset register. If the value needs lowercase letters or other characters, check Code 128 instead. Preserve the quiet zones and test the final label.

Code 39 Barcode Generator

EAN-13 symbol encoding the demonstration number 5901234123457
5901234123457

Encoded value — 5901234123457 is a demonstration number with 13 digits, including the final check digit. It is not assigned to your product.

Bars and spaces — This linear symbol represents digits using bars and spaces. Keep the clear margins at both ends intact when placing the artwork.

Scanner result — A compatible scanner returns 5901234123457. The receiving retail system uses that number to look up the product; the symbol itself does not store its name or price.

Before production — Use the GTIN assigned to the actual product and confirm every digit against its record. Drawing a barcode or calculating a check digit does not assign or register a product identifier.

EAN-13 Barcode Generator

EAN-8 symbol showing the demonstration value 96385074
96385074

Encoded value — 96385074 is an eight-digit demonstration number, including its final check digit. It is not an identifier assigned to your product.

How it reads — A compatible EAN-8 scanner returns the product number. The receiving checkout system uses that number to find the product record and price.

Use it correctly — EAN-8 needs its own assigned GTIN-8. It is not an EAN-13 number shortened to fit a small package. Keep the full symbol and its quiet zones clear.

EAN-8 Barcode Generator

UPC-A symbol showing the demonstration value 036000291452
036000291452

Encoded value — 036000291452 is a 12-digit demonstration number, including the leading zero and final check digit. It is not assigned to your product.

How it reads — A compatible UPC-A reader returns the product identifier. The retail database supplies the matching product details and price; those details are not stored in the bars.

Use it correctly — Use the number assigned to the actual product and variation. Keep it as text in spreadsheets so its leading zero is preserved, then compare it with the product record.

UPC-A Barcode Generator

UPC-E symbol showing the demonstration value 04252614
04252614

Encoded value — 04252614 is the full eight-digit UPC-E demonstration input: a number-system digit, six data digits and a check digit.

How it reads — UPC-E suppresses zeros in an eligible UPC-A number. Depending on reader settings, the scanner may report the compact UPC-E value or expand it to UPC-A. Check which representation your software expects.

Use it correctly — Not every UPC-A number can be represented as UPC-E. Do not remove zeros yourself or enter an arbitrary six-digit stock reference. Use an assigned identifier that qualifies for this format.

UPC-E Barcode Generator

ITF-14 symbol showing the demonstration value 10012345000017
10012345000017

Encoded value — 10012345000017 is a demonstration GTIN represented as 14 digits, including its check digit. It illustrates a case or carton identifier, not an identifier assigned to your packaging.

How it reads — A compatible ITF-14 reader returns the identifier for the receiving logistics system. The thick bearer bars around the example are part of the artwork and should be preserved.

Use it correctly — Use the GTIN for the correct packaging level. Changing a leading digit does not assign a new carton identifier. ITF-14 is not a substitute for the retail checkout symbol required on a consumer unit.

ITF-14 Barcode Generator

GS1-128 symbol showing the demonstration value (01)10012345000017(17)271231(10)LOT-27
(01)10012345000017(17)271231(10)LOT-27

Encoded fields — This demonstration uses AI 01 for GTIN 10012345000017, AI 17 for expiration date 271231 (31 December 2027), and AI 10 for lot LOT-27. These are example values, not data assigned to your products.

How it reads — A compatible receiving system interprets the Application Identifiers and GS1 separators. The parentheses in the displayed caption label the fields; they are not literal parentheses encoded as ordinary text.

Use it correctly — GS1-128 uses Code 128 patterns with GS1 data structure. Typing the caption into an ordinary Code 128 field does not create the same structured symbol. Use the GS1 fields and follow your receiving partner’s requirements.

GS1-128 Barcode Generator

ISBN symbol showing the demonstration value 978-0-306-40615-7
978-0-306-40615-7

Encoded value — The caption formats the example ISBN as 978-0-306-40615-7. The EAN-13 bars encode the 13 digits 9780306406157, without the caption’s hyphens.

How it reads — A compatible EAN-13 reader returns the number used by the receiving book system. The ISBN identifies the publication and its edition or format; the artwork does not issue or register an ISBN.

Use it correctly — Use the ISBN assigned to the actual publication, edition and format. This example has no price supplement. Add a supplement only when the distributor provides the required value.

ISBN Barcode Generator

Ordinary Data Matrix symbol encoding the internal reference PART-4827
PART-4827

Encoded value — PART-4827 is an internal parts reference. It is example data chosen for this symbol, not an assigned retail product number.

Square modules — The data is represented by a two-dimensional grid of modules rather than a single row of bars. Keep the clear space on every side of the symbol.

Scanner result — A reader that supports Data Matrix returns PART-4827. A linear-only reader cannot decode this 2D pattern. The receiving parts system supplies the matching record.

Ordinary Data Matrix — This example uses ordinary Data Matrix, not GS1 DataMatrix. Confirm the required data syntax, reader support and final printed size for your own workflow.

Data Matrix Generator

All ten symbols use demonstration data. The retail, logistics and book identifiers are not assigned to your products or publications. Internal references do not create database records. Check the identifier, reader settings and final printed size before use.

How does a barcode work?

A scanner reads the pattern; the receiving software decides what the decoded value means.

Encode the value

An encoder turns STOCK-4827 into the bars and spaces defined by Code 128. The format adds the start, stop and check information used by a reader.

Decode the pattern

A compatible scanner reads the pattern and returns STOCK-4827. It returns the encoded value; it does not get a product name or price from the symbol.

Find the matching record

Your inventory software uses STOCK-4827 to find its existing record. That record supplies the product name, price or stock information; drawing the symbol does not create it.

1D vs. 2D barcodes: what changes?

Compare the linear EAN-13 labels and square Data Matrix labels shown below. The format, encoded data and receiving system determine which one fits your task.

Two sizes of the same retail product, 250 ml and 500 ml, with different EAN-13 product identifiers.

Linear (1D) barcodes

Pattern: bars and spaces arranged along one axis.

Data: product numbers (EAN, UPC and ITF-14), internal references (Code 128 and Code 39), or structured fields (GS1-128), depending on the format.

Reader: a scanner configured for that linear format, or a camera app that supports it.

Two Data Matrix symbols at the same size encode a short identifier and a longer internal record.

Two-dimensional (2D) barcodes

Pattern: matrix formats such as Data Matrix and QR Code use a grid of small squares, called modules.

Data: an identifier or other content. Examples include Data Matrix for compact internal references and QR Code for a website link. Capacity depends on the format, data and symbol size.

Reader: a compatible 2D imager or camera app. A linear-only scanner cannot decode the grid.

Barcode vs. QR code: what is the difference?

A QR code is a barcode too: a two-dimensional one. People often say “barcode” for the linear kind only. The difference lies in what each one carries and what can read it. Select an underlined label for details.

Linear barcode and QR code compared · sources checked 17 November 2026
What changesLinear barcodeQR code

Pattern

Square grid of modules

A square grid of small squares, called modules

Content

Identifier or website link

An identifier or other content, such as a website link

Capacity

Up to 7,089 digits

In the largest version, with digits only and the lowest error correction level

If damaged

Can restore the data

Error correction can restore the data when part of the symbol is dirty or damaged

Reader

2D imager or camera app

A 2D imager or a camera app; a linear-only scanner cannot decode it

Source for the QR code capacity: DENSO WAVE, QR code versions.

Find the right barcode for your use

Explore ten formats through five everyday uses. Compare barcode types to check input rules and reader requirements. The examples use demonstration data, not identifiers assigned to your products.

A blue item labelled SKU-2048-BLUE and a storage bin labelled BIN-A-03, each with its own Code 128 barcode.

Inventory and equipment

Use Code 128 for stock and location references, or Code 39 for asset IDs in systems that expect uppercase letters and digits.

A single retail item and a three-item multipack with different EAN-13 barcodes.

Retail products

Match an assigned retail product number to EAN-13, EAN-8 or UPC-A. UPC-E fits eligible UPC numbers into a compact symbol.

A six-unit case and a twelve-unit case with different ITF-14 carton identifiers.

Cartons and logistics

ITF-14 identifies distribution cases. GS1-128 can carry identifiers with fields such as a lot or expiration date.

A book and a stack of unchanged reprints use the same ISBN barcode, cover and binding.

Books

The publication’s assigned ISBN is rendered as EAN-13 artwork. Keep the edition and format consistent.

A Data Matrix contains PART=2048;SER=0091, interpreted as two fields by an external application.

Small parts

Data Matrix fits compact internal references into small label areas. Use a compatible 2D reader; this creator supports ordinary Data Matrix, distinct from GS1 DataMatrix.

Create a barcode

Check the identifier before you print

Creating a barcode symbol does not assign or register a GTIN (Global Trade Item Number) or a book’s ISBN. Follow the identifier’s allocation rules. A check digit only checks the number’s structure. Before use, verify the encoded value, quiet zones and final printed size.

GS1 US explains product identifiers. DENSO WAVE explains barcode anatomy. To read an existing symbol from your camera or an image, use the barcode scanner online.

Questions and answers

It depends on the format and the value supplied. EAN and UPC usually carry a product identifier; an internal Code 128 may carry a stock reference. GS1-128 can carry multiple structured fields. The product name or price often comes from the database that looks up the identifier.

Barcode is a broad term for machine-readable symbols. Linear barcodes use bars and spaces; QR codes and Data Matrix are two-dimensional formats. They have different capacity, reader and application requirements. Compare the ten supported barcode formats for their data and reader requirements.

Identical units of the same retail product can carry the same GTIN barcode. Different products or variants need the identifiers assigned under the relevant allocation rules. An internal system defines whether its reference identifies a product, a location or an individual item. Changing the barcode artwork or colour does not create a different identifier.

A number with the correct length or check digit is not necessarily assigned to your product. Follow the identifier allocation process and the retailer’s requirements. Use invented values only for controlled tests or internal records.

For retail, the number comes first. GS1 issues Global Trade Item Numbers (GTINs) through its local offices. In the United Kingdom, the local office is GS1 UK. Once you have the number, a generator draws it as an EAN or UPC symbol. Internal references, such as stock or asset IDs, need no registration: your own system defines them.

The numbers under a barcode show the encoded value in a form people can read. Under an EAN-13, the 13 digits are the product number, check digit included. A scanner reads the same 13 digits from the bars.