What Is a Barcode and How Does It Work?
Learn what a barcode is, what barcode numbers mean, how barcode scanners and readers decode symbols, and how UPC, EAN, 1D and 2D formats differ.

Quick definition
What is a barcode? It is a machine-readable code that represents data through a defined pattern. Linear formats use bars and spaces across one axis. Two-dimensional formats use modules or stacked rows across two axes. A scanner identifies the symbology, measures the pattern, corrects permitted errors, and returns the encoded characters.
The returned value is often a key into another system. A retail UPC may identify a trade item, but the current name and price come from a store database. An internal Code 128 label may identify an asset whose location and status live in inventory software.
How does a barcode work?
Each symbology defines start or finder patterns, data encoding, dimensions, and often a check digit or error correction. A reader illuminates or photographs the symbol, converts contrast into measurements, finds its orientation, decodes valid character patterns, and sends the result to an application.
Laser scanners are associated with linear bars, while camera-based imagers can read linear and 2D formats. Device configuration matters: a scanner may disable a symbology or add a prefix, suffix, or carriage return before sending data.

Linear barcode meaning
UPC-A and EAN-13 carry fixed-length numeric retail identifiers and use a final check digit. Code 128 supports printable ASCII and is common in inventory and logistics. Linear symbols need sufficient width, sharp vertical edges, and blank quiet zones. Long values make them wider.
A check digit helps catch common transcription errors. It does not prove that the identifier is assigned, genuine, current, or associated with the visible product.
Two-dimensional formats
QR, Data Matrix, PDF417, and Aztec arrange data in two dimensions. QR is widely recognized by phone cameras for URLs and consumer actions. Data Matrix is compact for industrial marking. PDF417 stacks rows for larger document data. Aztec uses a center finder and appears in some transport workflows.
The formats are not interchangeable. The receiving scanner and application must explicitly support the symbol and payload syntax. Rendering official-looking data does not create a valid ticket, license, or regulated label.
Product identifiers and databases
A barcode for retail products typically carries a GTIN assigned under GS1 rules. The brand owner maintains assignments, and trading partners load product records. Generating bars from invented digits can create a mathematically valid collision. Use an authorized identifier, then render it as the requested UPC-A or EAN-13 symbol.
A product lookup catalog is separate again. Missing third-party data does not invalidate a number, and a matching title does not prove authenticity. Confirm important information with the manufacturer, retailer, or an official registry.
Print quality
Dark-on-light contrast, quiet zones, module or bar width, printer resolution, material, curvature, glare, and damage all influence scanning. Do not stretch a symbol or use a screenshot. Download SVG where available, preserve proportions, and test a final production sample with the field reader.
Formal retail acceptance may require verification grades beyond an ordinary phone scan. QRBarcode renders and tests supported formats but does not certify a package.
Security and privacy
Encoding is not encryption. Anyone with a compatible reader can recover visible label data. Do not put credentials or private records into public symbols. Treat decoded text as untrusted input before opening a URL, running a lookup, or passing it into a privileged system.
Use the barcode generator to render a supported value or the barcode scanner online to see a detected format and payload.
What is a barcode in an application?
Inside software, a scan is usually a string plus optional symbology information. The application validates that string, looks up a record, and decides what action is allowed. The machine-readable code should not be trusted as authorization. A copied asset label can contain a real identifier, and a copied retail symbol can name a real product.
Build explicit states for unknown, inactive, duplicate, expired, unauthorized, and malformed values. Preserve leading zeroes and avoid numeric types that round long identifiers. Log operational events proportionately without collecting unnecessary personal information.
Label lifecycle
Assign an owner, source record, print template, printer, material, placement, inspection interval, and retirement rule. Replace damaged labels without allocating a new identity unless the business record itself changes. Destroy unused stock when an identifier is retired.
For product identifiers, coordinate changes with GS1 and trading partners. For internal codes, coordinate database migrations before old readers or formats are removed. A barcode meaning lasts only while a maintained system understands the value.
Explain the workflow to users
Print human-readable text and give operators a recovery path. A failed scan should lead to inspection or manual entry, not creation of an unrelated record. Training should distinguish “cannot decode” from “decoded but not found,” because those states have different causes and fixes.
What is a barcode in that recovery process? It remains an input, not proof that the requested action is valid.