Home · Learn · What Is a Barcode? How They Work, Types & Why They Matter

What Is a Barcode? How They Work, Types & Why They Matter

A barcode is a pattern of bars and spaces that encodes data for fast machine reading. Here is how barcodes work, the major types, and how to make your own.

UPC-A example

A barcode is a machine-readable visual representation of data. The traditional 1D barcode uses parallel black bars and white spaces of varying widths to encode characters; modern 2D barcodes like QR codes and Data Matrix use a grid of dots to pack much more information into the same footprint. A scanner reads the pattern, decodes it back into characters, and passes those characters to a computer system.

Barcodes have been on retail packaging since 1974 — the first product ever scanned was a pack of Wrigley's gum at a supermarket in Troy, Ohio. Today they appear on virtually every retail product, every shipping label, every hospital wristband, every transit ticket, and every component on a manufacturing line.

How a barcode works

Each printed bar and gap in a 1D barcode represents a specific character — width and pattern combinations encode a digit or letter. When you scan with a laser scanner or imaging camera, the scanner measures light reflected from the white spaces and absorbed by the black bars. Decoder firmware translates the timing pattern into characters and validates the check digit (most barcode standards have one). The result is passed to your POS, inventory, or shipping system in milliseconds.

1D vs 2D barcodes

1D (linear) barcodes — UPC-A, EAN-13, Code 128, ITF-14, Code 39 — encode data horizontally as parallel bars. They hold 20-25 characters and need a horizontal scan to read. 2D barcodes — QR Code, Data Matrix, PDF417, Aztec — encode data in a grid pattern across both axes. They hold thousands of characters in a smaller footprint, work omnidirectionally, and survive damage thanks to built-in error correction. 1D for fast retail POS; 2D for serialization, marketing, and small components.

The major barcode types

Retail: UPC-A (US), EAN-13 (international), EAN-8 (small packaging), ISBN (books). Logistics: Code 128, GS1-128 (shipping with embedded lot/expiry), ITF-14 (cases). Identification: FNSKU (Amazon FBA labels), Code 39 (auto parts, defense). 2D: QR Code (marketing, links), Data Matrix (pharma serialization, electronics, healthcare UDI), PDF417 (driver's licenses), Aztec (transit tickets), MaxiCode (UPS routing).

How to make a barcode

For retail: register with GS1 to get a Company Prefix, create your GTIN within that namespace, then render the GTIN as the appropriate barcode (UPC-A, EAN-13, etc.) using a generator. For internal use, shipping labels, or asset tags, you can use any valid alphanumeric value with Code 128 or Data Matrix — no GS1 registration needed. Either way, our free barcode generator above renders syntactically valid, scannable barcodes in PNG, SVG, PDF, or EPS.

FAQ

What is a barcode in simple words?

A barcode is a visual pattern of black and white bars (or dots, for 2D codes) that a scanner can read and convert into characters or numbers. It lets a computer identify a product, package, or item in milliseconds without anyone typing anything.

What is the purpose of a barcode?

To eliminate manual data entry. Barcodes let scanners instantly read a product's identifier, look up details in a database, and process the transaction — at retail checkouts, in warehouses, on shipping labels, in hospital workflows, and across manufacturing lines. Faster than typing, accurate to 99.99%+ in standard print quality.

What's the difference between a QR code and a barcode?

Both are barcodes — the term 'barcode' covers everything, including QR codes. The colloquial distinction: 'barcode' usually means a traditional 1D linear code with vertical bars (UPC, EAN, Code 128). 'QR code' specifically means the square 2D code with three locator squares at the corners. QR codes hold far more data and can be scanned from any angle including from a smartphone screen.

Are barcodes still used today?

Yes — more than ever. 1D barcodes remain the standard for retail POS because they scan faster on dedicated scanners. 2D barcodes (QR codes, Data Matrix) are growing in marketing, pharma serialization, healthcare UDI, and any application that needs more data per square millimeter. The migration is from 1D to 2D, not from barcodes to something else.

Can I create my own barcode?

Yes — you can generate a syntactically valid barcode for free using our generator above (UPC-A, EAN-13, Code 128, Data Matrix, etc.) for internal use, prototypes, asset tagging, or any context where GS1 registration isn't required. For retail listings on Amazon, Walmart, or Google Shopping, the barcode must encode a GS1-registered GTIN that resolves to your brand — for that, register with GS1 first, then generate the barcode rendering your assigned GTIN.

How does a barcode scanner work?

A laser scanner shoots a red laser line across the barcode and measures how light reflects back from the white spaces vs the black bars. An imaging scanner (or smartphone camera) takes a picture and uses image processing to decode the same pattern. Either way, the decoder firmware identifies the symbology (UPC, Code 128, QR, etc.), reads the encoded characters, validates the check digit, and outputs the decoded string.

Related generators

Need a real barcode now?

Generate a valid UPC-A barcode in seconds — no signup, no watermark. Free for casual use; paid plans from $9/mo for higher volume.

Related topics