Barcode Generator
Generate Code128, EAN-13, UPC-A, Code39 and other 1D barcodes.
Choosing the Right Barcode Symbology — and Why the Wrong Choice Causes Scanner Failures
A warehouse manager generates a Code39 barcode for a new inventory label and finds that the company's handheld scanners read it fine, but the receiving dock's fixed scanner — installed by a logistics partner — rejects it silently. The symbologies are not universally supported: some scanners are programmed to accept only specific formats. Before generating barcodes for a system you do not control, confirm which symbologies the target scanner supports.
Different symbologies exist because 1D barcodes were developed independently for different industries across five decades, each optimizing for different constraints: character set requirements, data density, decode reliability, existing scanner installed base, and standard compliance for regulated industries.
The Major 1D Barcode Symbologies
Code 128 is the most capable general-purpose 1D symbology and the correct default choice for internal barcodes. It encodes the full ASCII character set (all 128 characters, including lowercase, digits, and special characters), uses variable length, and has a built-in check digit. Three subsets (A, B, C) allow switching within a code to optimize data density — subset C encodes pairs of digits using single barcode characters, achieving higher density for numeric-only data. Code 128 is the mandatory symbology for GS1-128 (formerly EAN-128), used on shipping cartons, pallets, and logistics labels globally.
EAN-13 (European Article Number) is the global standard for retail product barcodes outside North America. It encodes exactly 13 digits — a GS1 company prefix (7–11 digits depending on allocation), an item reference, and a single check digit. The first two or three digits indicate the country of GS1 member registration (not product origin — a German company selling a product made in China still uses its German-registered prefix). The check digit is computed using the Luhn-adjacent alternating-weight formula: assign weights 1 and 3 alternately to the first 12 digits (left to right), sum the products, the check digit is (10 − (sum mod 10)) mod 10.
UPC-A (Universal Product Code) is the 12-digit format dominant in the US and Canada. Structurally identical to EAN-13 minus the leading 0 digit — UPC-A barcodes can be read as EAN-13 by modern scanners, and most retail point-of-sale systems accept both. A UPC-A barcode with a leading-zero prefix is EAN-13 compatible.
Code 39 is one of the oldest symbologies (1974) and remains in use in specific regulated industries: US Department of Defense labeling standards and some automotive supply chains still specify Code 39 by name. Its character set is limited to 43 characters: uppercase A–Z, digits 0–9, and the special characters space, dollar sign, percent, plus, hyphen, period, and slash. It is self-checking (each character contains a fixed number of narrow/wide bars that provides implicit verification) but has no additional check digit by default. Code 39 is less space-efficient than Code 128 — for new implementations where Code 39 is not mandated, Code 128 produces shorter barcodes for the same data.
GS1 Numbers — Why You Cannot Invent Your Own
EAN-13 and UPC-A barcodes are registered identifiers within the GS1 global system. The company prefix is assigned by a GS1 member organization in your country. Using a self-assigned prefix on retail products risks collision with another company's legitimate products — a barcode scanner at a retailer's point of sale queries a central product database, and an unregistered barcode returns no product or worse, another company's product. GS1 company prefix registration costs vary by country and expected product volume (starting around $250/year for small businesses in the US).
For internal barcodes — warehouse bin labels, asset tags, employee badges, shipping cartons within a closed logistics system — you do not need GS1 registration. Use Code 128 with your own internal numbering scheme; the GS1 registry is only relevant for barcodes that appear on consumer retail products.
Print Specifications for Scan Reliability
The X-dimension is the width of the narrowest bar, the fundamental unit of a barcode. The ratio of wide bars to narrow bars (typically 2.5:1 or 3:1) determines the barcode's tolerance for print gain. Critical print specifications:
- Minimum X-dimension: 0.25mm for high-resolution laser printers; 0.33mm for inkjet. Below these thresholds, narrow bars merge together under print gain.
- Quiet zone: empty space at both ends — Code 128 requires 10× the X-dimension minimum. On labels, this is typically 2–3mm.
- Bar height: at least 15% of barcode length or 6.35mm, whichever is greater. Short barcodes are harder for handheld scanners to capture in a single sweep.
How to Use This Tool
- Select the symbology: Code 128 for general use, EAN-13 or UPC-A for retail products, Code 39 only if specifically required by your target system.
- Enter the value. EAN-13 requires exactly 12 digits (the 13th check digit is computed automatically).
- Adjust width multiplier and height to meet your print specification.
- Download as SVG for scalable print output, or PNG at the highest resolution available for raster use.
▢ FAQ
01 Why does my EAN-13 input get rejected? +
EAN-13 accepts exactly 12 or 13 digits. If you enter 12 digits, the tool computes and appends the check digit. If you enter 13 digits, the tool verifies the check digit using the alternating-weight formula. Non-digit characters, wrong length, or an invalid check digit all cause rejection. The GS1 check digit calculation: multiply alternating digits by 1 and 3 (odd positions by 1, even by 3, left to right); sum the products; check digit = (10 − (sum mod 10)) mod 10.
02 Can I use Code 128 for shipping labels? +
Yes — GS1-128 (a profile of Code 128 with GS1 Application Identifiers) is the standard for shipping carton labels. Application Identifiers (AI codes in parentheses) encode structured data: AI(00) for SSCC pallet serial, AI(02) for GTIN-14, AI(17) for expiry date, etc. For general internal shipping labels within a closed logistics system, plain Code 128 without GS1 AIs is simpler and fully compatible with most warehouse management systems.
03 What is the difference between SVG and PNG download for barcodes? +
SVG is a vector format: the barcode scales to any size without pixelation, making it the correct choice for print workflows where the output size may not be known in advance. PNG is a raster format at a fixed resolution. For barcodes destined for print, always prefer SVG. Use PNG only when the target application does not support SVG (some label design software, email templates).
04 My scanner reads some barcodes but not others from this tool — what is wrong? +
The most likely cause is that the scanner is configured for specific symbologies only. Many industrial and retail scanners have a symbology enable/disable configuration accessible through the scanner's programming manual. Scan the scanner's "enable all symbologies" setup barcode (in the manual) and test again. If the scanner still fails, check the minimum X-dimension requirement — some scanners specify a minimum bar width that must match your print setup.