"Barcode" gets used loosely to mean any scannable code, but there are actually several distinct standards under that umbrella, each with its own rules about what it can encode and where it's used — and picking the wrong one is the most common reason a generated barcode doesn't actually work as intended.
Barcode vs. QR Code
A traditional barcode is one-dimensional: a series of parallel lines of varying widths that a scanner reads along a single horizontal pass, typically storing a short numeric or alphanumeric string. A QR code is two-dimensional, arranging data in a square grid instead of a line, which lets it hold far more information and be read by a camera from any angle, not just a laser passing straight across it. Traditional barcodes remain the standard for retail point-of-sale systems specifically because that infrastructure was built around them; QR codes tend to be used where more data or camera-based scanning (like from a phone) matters more.
How a Scanner Reads the Bars
Each barcode format defines an exact table mapping specific widths of bars and spaces to specific characters, along with a start pattern and stop pattern marking where the encoded data begins and ends. A scanner's sensor measures the precise width of each bar and gap it passes over, matches those widths against the format's table, and reconstructs the original value character by character. Most formats also embed a checksum — a digit calculated from all the other digits using a fixed formula — so a scanner can verify the read was correct rather than silently accepting a smudged or misread scan.
Why Retail Barcodes Need Registered Numbers
UPC-A and EAN-13 are the barcode formats used on virtually all retail packaging, and for genuine retail use, the number itself isn't arbitrary — it needs to come from an officially registered range, typically issued through GS1, the organization that coordinates global product numbering so that no two products anywhere end up with the same code. A barcode generator can technically produce a scannable UPC-A or EAN-13 image from any correctly formatted number, but if that number wasn't actually registered, it won't correspond to your product in any retail point-of-sale or inventory system — it'll just be a barcode that scans to the wrong thing, or nothing at all.
Choosing the Right Format
For anything that isn't going into a retail supply chain — internal inventory tracking, event tickets, asset tags, library systems — CODE128 is usually the most practical choice, since it encodes a wide range of letters, numbers, and symbols without the strict digit-count and registration requirements that retail formats carry. CODE39 is an older but still common alternative, particularly in some industrial and logistics settings. ITF-14 is specifically used for shipping cartons and pallets rather than individual retail units. Matching the format to its intended use case avoids the most common source of "why doesn't this scan" problems.
Generating One Instantly
Generate a scannable barcode in CODE128, EAN-13, UPC-A, CODE39, ITF-14, and more, with a live preview, using the free Barcode Generator.
FAQ
What's the difference between a barcode and a QR code? A traditional barcode is one-dimensional — a series of parallel lines that a scanner reads along a single horizontal pass — and typically stores a short numeric or alphanumeric code. A QR code is two-dimensional, storing far more data in a square grid, and can be scanned from any angle by a camera, not just a laser scanner.
How does a scanner actually turn a series of bars into data? Each barcode format defines a set of precise bar-and-space width patterns that correspond to specific characters or digits, plus start and stop patterns marking where the code begins and ends. A scanner measures the exact widths of the bars and gaps it detects, looks up which characters those widths correspond to, and reconstructs the encoded value — most formats also include a checksum digit calculated from the other digits, so the scanner can detect a misread instead of silently returning the wrong value.
Which barcode format should I use? CODE128 is the most flexible default, encoding any letters, numbers, and most symbols, which makes it a safe general-purpose choice. UPC-A and EAN-13 are the standard formats for retail products but require an officially registered number and an exact digit count to be genuinely scannable at a real point of sale — don't use them for made-up numbers on products you intend to sell through retail systems.
Can I encode any text in any format? No — each format has its own rules. CODE128 and CODE39 accept a wide range of letters and symbols. EAN-13 requires exactly 12 or 13 digits, UPC-A requires exactly 11 or 12 digits, and ITF-14 requires an even number of digits. Entering the wrong length or an unsupported character for a given format will show an error instead of a barcode.