Barcode Generator
Generate Code128, EAN-13, EAN-8, UPC-A, Code39, ITF-14, MSI and Pharmacode barcodes with live GS1 check-digit verification. Download SVG or PNG in browser.
About Barcode Generator
A barcode is a machine-readable representation of data in visual form. This tool allows you to create various types of barcodes for products, inventory management, shipping, and more with extensive customization options.
What's the best barcode type for my product?
It depends on where you'll scan it. For retail products sold internationally, use EAN-13 (13 digits, the global standard governed by GS1). For US/Canada retail use UPC-A (12 digits, same underlying GS1 system). For internal inventory, asset tracking, or library books where you don't need retail compliance, Code 128 is the most efficient choice — it encodes the full ASCII set in a compact symbol and has three subsets (A, B, C) that auto-switch for maximum density. Code 39 is older, less dense, but extremely robust and supported by every legacy scanner — common in defense, automotive, and healthcare logistics. For tiny packaging where space matters, EAN-8 (8 digits) is the abbreviated GS1 variant. For pharmaceuticals and traceability, GS1-128 (formerly UCC/EAN-128) embeds Application Identifiers like batch numbers and expiration dates.
What's the difference between a barcode and a QR code?
Barcodes (called "1D" or linear) encode data as the widths and spacings of parallel vertical lines, readable in one dimension by a laser line. QR codes (called "2D" or matrix) encode data in a 2D grid of black and white squares, requiring a camera to capture the full image. Linear barcodes typically hold 8-30 characters and need a clean horizontal scan line; QR codes hold up to 7,089 numeric characters or 4,296 alphanumeric and can be scanned at any rotation. Linear barcodes are cheaper to print, faster to scan with dedicated laser scanners, and required for legacy POS systems and GS1 retail compliance. QR codes work with any smartphone camera, encode much more data, and tolerate partial damage via Reed-Solomon correction. Use linear for retail SKU and inventory; use QR for URLs, contact info, and rich data.
Why does my EAN-13 barcode get rejected by the retailer?
EAN-13 barcodes require a valid GS1 company prefix that you must purchase from your local GS1 member organization — making up a random 13-digit number will fail at the retailer's POS database lookup, even if the barcode itself scans fine. The 13 digits break down as: 2-3 digit country/region code (assigned by GS1), 4-9 digit company prefix (assigned to your business), product number (you choose), and a final check digit (calculated). The check digit uses a weighted modulo-10 algorithm: multiply digits at odd positions by 1 and even positions by 3, sum, and the check digit is whatever makes the total divisible by 10. This calculator verifies the check digit automatically, but only GS1 can assign you a valid prefix. Annual fees range from $250 to several thousand dollars depending on company revenue.
What's the smallest size I can print a barcode and still have it scan?
The GS1 General Specifications define an "X-dimension" (the width of the narrowest bar) of 0.264 mm to 0.660 mm for retail POS scanning, with a magnification factor between 80% and 200% of nominal. For EAN-13 at 100% magnification, the symbol is 37.29 mm wide and 25.93 mm tall (including the human-readable digits and quiet zones). For Code 128, X-dimension as small as 0.19 mm works for high-resolution thermal printers and CCD scanners, but most laser scanners need 0.25 mm minimum. Always include quiet zones — for EAN/UPC, at least 10× the X-dimension on left and 7× on right; for Code 128, at least 10× on both sides. Truncating the height below 80% of standard hurts readability with laser scanners that drift off-axis. Test prints with the actual scanner model your downstream users will deploy.

Can I encode special characters or non-English text in a barcode?
Linear barcode capabilities vary sharply by symbology. EAN/UPC encode only digits 0-9. Code 39 (basic) encodes 43 characters: A-Z uppercase, 0-9, and the symbols - . space $ / + %. Code 39 Extended uses pairs of characters to encode the full ASCII set but doubles symbol length. Code 128 natively encodes all 128 ASCII characters using three switchable subsets and offers the highest density of any common 1D code. None of these natively support Unicode or non-Latin scripts: for Vietnamese, Chinese, Arabic, or emoji, use QR codes or Data Matrix, both of which support UTF-8 via ECI (Extended Channel Interpretation) escape sequences. PDF417 is another 2D stacked code used on US driver's licenses and shipping labels that handles multi-byte data. For pure numeric IDs, ITF-14 (Interleaved 2-of-5) packs 14 digits compactly and is the GS1 standard for shipping cartons.
Why are there two different barcode standards: GS1 and proprietary?
GS1 (formerly EAN International and Uniform Code Council) is the global non-profit that administers product identification standards used in 150+ countries, ensuring every retail product has a unique number recognized worldwide. UPC, EAN, GTIN, GS1-128, ITF-14, and SSCC are all GS1 standards. They require paid membership and assignment of a company prefix to guarantee uniqueness. Proprietary or internal barcodes (Code 39, Code 128 used without GS1 Application Identifiers, Codabar, MSI Plessey) require no central registration — you can invent your own numbering scheme for warehouse bins, library books, employee badges, event tickets, or asset tags. The trade-off: GS1 codes work across the global retail supply chain; proprietary codes work only within your closed system but cost nothing and have no registration overhead.
How does a barcode check digit detect errors, and what errors does it miss?
Most barcode symbologies append a check digit calculated from the data digits using a weighted modulo arithmetic. UPC/EAN uses modulo-10 with weights 1,3,1,3,...; Code 128 uses a position-weighted modulo-103 sum; ISBN-10 uses modulo-11 with weights 10,9,8,...,1. Single-digit substitution errors are always caught: changing any one digit changes the check digit. Single adjacent transpositions (swapping two neighboring digits) are caught about 90% of the time with mod-10 weighted 1,3 (it misses transpositions where the digits differ by 5, like 27 ↔ 72). Mod-11 with sequential weights catches 100% of single-digit and adjacent transposition errors but produces an "X" character when the check is 10 — which is why ISBN-10 uses X but EAN avoided it to stay all-digits. No check digit catches scanner errors that misread the bars themselves: barcode readers add their own start/stop pattern verification and bar-width ratio checks on top.
What is GS1 Application Identifier (AI) and when do I need GS1-128 instead of plain Code 128?
GS1 Application Identifiers are 2-4 digit prefixes that label what follows in a GS1-128 barcode, enabling structured data beyond a simple ID. Common AIs include: (01) GTIN (14-digit product code), (10) batch/lot number, (17) expiration date YYMMDD, (21) serial number, (30) variable count, (310n) net weight in kg. A pharmaceutical box might encode (01)09501101530003(17)260531(10)A1B2C3 — meaning GTIN 09501101530003, expiration 31 May 2026, lot A1B2C3 — in a single GS1-128 symbol. Variable-length AIs are terminated with FNC1 character. Plain Code 128 is just generic data with no semantic structure; GS1-128 requires the AI structure and is mandated by industries like pharma (US DSCSA traceability), healthcare medical devices (UDI), and logistics shipping (SSCC pallet labels). Use GS1-128 only when downstream systems expect AI parsing; for internal use, plain Code 128 is simpler.
How is the EAN-13 / UPC check digit calculated, and how do I verify mine is correct?
The final digit of an EAN-13, EAN-8, UPC-A or ITF-14 number is a Modulo-10 check digit derived from the digits before it. To compute it by hand: starting from the rightmost data digit and moving left, multiply alternating digits by 3 and 1 (so the rightmost data digit is ×3, the next ×1, and so on), add the products, then the check digit is (10 − (sum mod 10)) mod 10. For EAN-13 12345678901(2) the data digits 123456789012 weight to a sum whose Modulo-10 complement is the printed 13th digit. You don't have to do this by hand here: select EAN-13 (or EAN-8 / UPC-A / ITF-14), type the code, and click Generate. If you omit the last digit the tool appends the correct one and shows an 'auto-added' badge; if you paste the full code it recomputes and shows a 'Valid' badge — or rejects it with the expected digit if it is wrong. This means the rendered and downloaded barcode always carries a GS1-valid check digit, so it will pass POS database lookups instead of scanning but failing at the till.
