- Which symbology fits the job — Code 128, EAN-13, UPC-A, EAN-8, ITF-14, Code 39
- Minimum barcode size, with a live X-dimension calculator
- Check-digit maths, worked out and checkable
- Why red bars fail on a laser and why red backgrounds fail on a camera
- The real causes of scan failures, including “fit to page”
- GS1 vs internal codes, GTIN vs EAN vs ASIN, and ISBN in India vs the US
- PNG vs SVG, 300 DPI, and quiet zones
- Batch generation and the Excel workflow
- A print-and-scan verification checklist
- Privacy — client-side rendering, nothing uploaded
What a barcode generator does — and what it cannot do
It converts a number or string you already own into a scannable image. It does not issue that number.
You paste a GTIN, SKU, serial or asset tag, choose a symbology, and export PNG or SVG. The bars are a drawing of that string. A scanner decodes the pattern and returns exactly the characters you typed — no lookup, no database, no product record attached.
That distinction decides most buying mistakes. A generator does three things and not one more: it validates length and character set, it calculates the check digit where the standard requires one, and it renders the module pattern. It cannot allocate a GTIN, it cannot tell you whether a number already belongs to another company, and it cannot register your product with a retailer or marketplace. Those steps are separate, and they are the ones that cost money.
This page covers 1D linear symbols only — Code 128, EAN-13, UPC-A, EAN-8, ITF-14 and Code 39. Two-dimensional symbols (QR, Data Matrix, PDF417) behave differently; the QR Code guide covers those.
Selling through a checkout counter or a marketplace? You need a GS1-issued number first, then a generator to draw it. Tracking your own stock, assets or shipments? Code 128 and any numbering scheme you like.
How encoding works
Four stages from typed data to downloadable image. Knowing them helps when a scan fails.
Data input
You enter digits or text. The tool checks that the data matches the chosen type (for example EAN-13 must be numeric and the right length).
Encoding
Each character becomes a fixed pattern of modules (narrow/wide bars and spaces). Check digits are calculated where the standard requires them.
Pattern assembly
Start and stop patterns, data, check digit and quiet zones (blank margins) are combined into one continuous symbol. Adjust bar height, width, and show/hide the text label under the bars as needed.
Render and download
The pattern is drawn to PNG or SVG. Optional human-readable text sits under the bars. The AFFLIGO Barcode Generator runs this in the browser so your data stays on the device. Always test-scan the first print before committing to a large run.
Check digit — the arithmetic, worked out
Every retail number ends in a digit calculated from the others. Get it wrong and the till rejects the scan before your system ever sees it.
A check digit is computed once when the number is assigned and again every time it is scanned. The reader recalculates it from the decoded bars. If the two disagree, the whole read is thrown away — which is how a single smudged bar becomes “invalid barcode” instead of the wrong price at the till.
EAN-13 and UPC-A both use weighted modulo-10, but with opposite weight order. EAN-13 weights the first digit 1; UPC-A weights it 3. That one detail is why a UPC check digit pasted into an EAN field always fails.
| Step | EAN-13 example | UPC-A example |
|---|---|---|
| Base digits | 4 0 0 6 3 8 1 3 3 3 9 3 | 0 3 6 0 0 0 2 9 1 4 5 |
| Weights | 1 3 1 3 1 3 1 3 1 3 1 3 | 3 1 3 1 3 1 3 1 3 1 3 |
| Weighted sum | 89 | 58 |
| Sum mod 10 | 9 | 8 |
| (10 − remainder) mod 10 | 1 | 2 |
| Full number | 4006381333931 | 036000291452 |
Enter the first 12 digits (without the check digit).
Code 128 uses a modulo-103 check symbol inside its structure, and Code 39 has an optional Mod 43 check. Neither is visible to a human reading the label, so there is nothing to calculate by hand — the encoder handles both.
A made-up 13-digit string will usually pass its own check digit — the maths does not know the number is fake. It fails later, when a retailer's catalogue rejects it or the scanner resolves it to someone else's product. Check digit validity is not ownership.
Types compared — and which one to pick
Pick by where the code will be scanned, not by which one looks tidier. Wrong symbology is the most common beginner mistake, and the most expensive one.
| Feature | Code 128 | EAN-13 | UPC-A | Code 39 |
|---|---|---|---|---|
| Character set | Full ASCII | Digits only | Digits only | A–Z, 0–9, limited symbols |
| Typical length | Variable | 12 + check | 11 + check | Variable (often short) |
| Retail POS | No | Yes (global) | Yes (US/Canada) | No |
| GS1 number required | No | Yes for retail | Yes for retail | No |
| Density | High | Medium | Medium | Lower |
| Best for | Inventory, shipping | International products | US/Canada products | Assets, industrial |
| Situation | Use | Why |
|---|---|---|
| Product sold in stores worldwide | EAN-13 | Global retail standard; GS1 number required |
| Product sold mainly in US/Canada | UPC-A | North American retail standard |
| Small package with no room for 13 digits | EAN-8 | Same standard, 8 digits; still needs a GS1 number |
| Shipping carton or pallet label | ITF-14 | Prints on corrugated board; carries an SSCC or GTIN-14 |
| Internal warehouse / SKU labels | Code 128 | Alphanumeric, compact, no GS1 needed |
| Asset tags, equipment IDs | Code 128 or Code 39 | Internal systems; Code 39 still common in industry |
| Amazon / marketplace listings | EAN-13 or UPC as required | Must match marketplace rules and number ownership |
| Books | EAN-13 | ISBN-13 is EAN-13 with a 978/979 prefix; enter all 13 digits |
Creating a barcode image does not give you the right to use that number in global retail. For store shelves and most marketplaces you need a GS1-issued GTIN. Invented numbers collide with real products and get listings rejected — see section 9.
If you only need internal tracking, skip GS1 entirely and use Code 128 with your own scheme. Document the format once so every team uses the same rules. A one-page internal standard beats a dozen conflicting SKU styles.
Not covered by this tool: two-dimensional symbols (Data Matrix, PDF417, Aztec) and compressed UPC-E — use full UPC-A instead.
Barcode vs QR code
Both encode data for a machine to read. They answer different questions: one identifies, the other explains.
| Feature | 1D Barcode (EAN/UPC/Code 128) | QR Code (2D) |
|---|---|---|
| Data capacity | 12 digits (EAN/UPC) up to ~80 characters (Code 128) | Up to 4,296 alphanumeric characters |
| Data type | Digits (EAN/UPC) or ASCII (Code 128) | Numbers, text, URLs, binary, Wi-Fi credentials |
| Scanner needed | Laser scanner or barcode gun | Phone camera or 2D imager |
| Scan direction | Must align horizontally | Any angle, 360 degrees |
| Error correction | Check digit only — no damage recovery | Reed-Solomon, up to 30% of the symbol recoverable |
| Retail POS | Yes — every grocery checkout laser reads these | Growing, but still not universal in 2026 |
| Best for | Retail checkout, inventory, shipping, asset tags | Marketing URLs, menus, Wi-Fi, product info pages |
Use a 1D barcode when the scan happens at a counter: POS, warehouse receiving, shipping sortation. The number is short, the laser is cheap, and the whole supply chain already speaks it.
Use a QR code when a human points a phone at it and expects something to happen — a menu, a warranty page, a Wi-Fi login. The processing power sits on the customer's side, so you can spend the space on context instead of a 13-digit key.
Use both when the product sells in a shop and also needs a story. The UPC handles the till; the QR carries the recipe, the batch data or the support page. Most packaged consumer goods made that move years ago.
GS1's Sunrise 2027 commits member organisations to accept 2D codes at point of sale alongside 1D codes by the end of 2027. It is an industry readiness target, not a worldwide switch, and adoption differs by country and retailer. If your product sells through chain retail now, print a UPC/EAN — and design the label so it can carry both later.
Minimum size — and the X-dimension calculator
There is a floor on how small a barcode can go. Print below it and the label looks perfect on screen, then fails at the till.
Every symbol has an X-dimension — the width of the narrowest bar, in millimetres. Total symbol width, bar height and quiet zone all scale from it. The standards set a minimum X per symbology; your printer's resolution decides whether you can physically hit it.
Here is the part most guides skip. At 203 DPI — a very common thermal label printer — one printer dot is 0.125 mm, so a 2-dot narrow bar is 0.250 mm. That clears Code 128 and sits just under the floor for EAN-13. At 300 DPI one dot is 0.085 mm: 3 dots gives 0.254 mm, and 4 dots gives 0.339 mm. No amount of zooming in the preview fixes a 2-dot EAN-13 on a 203 DPI head.
Do not confuse resolution with magnification. A 600 DPI printer running at 70% magnification still produces bars below the specification, because magnification is measured against the standard, not against your printer.
| Symbology | Minimum X | Symbol width | Notes |
|---|---|---|---|
| EAN-13 | 0.264 mm | 37.29 mm at 100%, 29.83 mm at 80% | 80–200% magnification; the 30 mm rule of thumb |
| UPC-A | 0.264 mm | 37.29 mm at 100% | Same geometry as EAN-13, one digit shorter |
| EAN-8 | 0.264 mm | 26.73 mm at 100% | For small packages; still needs a GS1 number |
| ITF-14 | 0.495 mm | Depends on data | Cartons; needs a heavy bar to survive corrugated printing |
| Code 128 | 0.250 mm | 11 modules per character | Quiet zone 10X on each side |
| Code 39 | 0.191 mm | 15 modules per character at 3:1 | Quiet zone 10X; wide bars make it bulky |
Minimums follow ISO/IEC 15417 (Code 128), 15420 (EAN/UPC) and 16388 (Code 39) plus the GS1 General Specifications. Confirm against the current edition for your market before a large print run.
Bar height: as a working rule keep at least 15 mm for handheld scanning, and more for fixed-mount conveyor scanners that read at an angle. A symbol that is wide but 6 mm tall scans badly no matter how clean the bars are.
Quiet zones: the blank margin on each side. EAN-13 uses 11X on the left and 7X on the right; Code 128 uses 10X. Design software crops them without warning when you drag a bounding box — that is one of the top three causes of a barcode that will not scan.
Color and contrast rules
Most POS scanners use a red laser at 630–680 nm. They measure reflectance — how much light bounces back from dark bars versus light spaces. Red ink reflects the red laser and appears invisible. Green absorbs it and appears black. That is the whole model, and it only applies to laser scanners.
| Color | As bar color | As background | Why |
|---|---|---|---|
| Black | Safe | Do not use | Absorbs red light — best bar color |
| Dark navy | Safe | Do not use | Absorbs red light |
| Dark green | Safe | Do not use | Absorbs red light |
| Dark brown | Safe | Do not use | Absorbs red light |
| Red | Never | Laser only | Reflects red laser — invisible to a laser, dark to a camera |
| Orange | Never | Laser only | Reflects red laser |
| Bright yellow | Never | Laser only | Reflects red laser |
| White | Do not use | Safe | Best background — reflects red light |
| Cream / light yellow | Do not use | Safe | Reflects red light |
Laser and camera scanners do not see color the same way. A red laser measures reflectance at one wavelength, which is why black bars on a red background can scan on an old checkout gun. A phone camera or 2D imager floods the label with white light and reads the whole visible spectrum — for those, red is simply dark. So a black-on-red label that passes on a laser counter can fail when the same label is checked with a handheld imager in the warehouse. If both will scan it, keep black on white.
Never invert. White bars on a black background look high-contrast to a designer and dead to a scanner: the scanner reads the black field as the space and the white bars as the bars, and every symbol comes out reversed.
Glossy vs matte: glossy stock reflects too much light and creates specular glare that blinds the scanner. Use matte label stock for warehouse and retail labels. If the packaging must be glossy, print a white flood area behind the barcode.
Transparent labels: on a colored bottle, the bottle becomes the background. Print a white underlay behind the barcode so contrast survives whatever is underneath.
Verify before you print a full run
A barcode that looks right on screen proves nothing. Six checks catch almost every dead label before the paper is wasted.
Turn off “fit to page”
In the print dialog choose Actual size or 100%. “Fit to page” and “scale to fit” silently shrink the symbol below its minimum X while the preview still looks correct. This is the single most common cause of a barcode that will not scan.
Measure the narrow bar
Compare the thinnest bar against the minimum for your symbology in the table above. A loupe or cheap calipers settle it in seconds; a ruler does not.
Check both quiet zones
11X on the left and 7X on the right for EAN-13, 10X each side for Code 128. No text, logo, edge or perforation inside them.
Scan with a phone first
If the phone decodes it, the data and the check digit are right and the print is legible. If the phone fails, do not go further — fix contrast, size or the quiet zone.
Scan with the real device
The till gun, the warehouse imager, the conveyor head. Phone passing and laser failing almost always means symbology settings on the device, not a bad label.
Repeat at real angles
Ten scans: flat, tilted, from 30 cm, from the side. A symbol that only reads when perfectly aligned will cost someone a shift on the loading dock.
Phone cameras are more forgiving than laser scanners in one direction and less in another. They read damaged and low-contrast labels better than a cheap laser — but they also decode inverted symbols that a laser refuses. A pass on a phone means the data is valid, not that the label is printable.
When this guide was last revised I generated a Code 128 asset tag and an EAN-13 sample, printed both at 100% on matte paper, and scanned them with a phone camera from 15 cm: both decoded first time. A second print at 70% still scanned, but the quiet zone was nearly gone — which is why 100% scale is the recommendation for anything that has to work at a checkout counter.
GTIN, EAN, UPC, ASIN — who owns the number
Drawing an image and owning the number are separate steps. Almost every retail failure comes from mixing them up.
To sell in physical retail or on most marketplaces you need a GTIN allocated through GS1. You then use a generator to turn that number into bars. The generator draws; GS1 allocates. A free tool cannot issue you a number, and it cannot tell you whether the one you typed already belongs to a shampoo brand in Taiwan.
| Term | What it actually is | Issued by |
|---|---|---|
| GTIN | Umbrella name for the product key; EAN-13 and UPC-A are shorter forms of the same idea | GS1 |
| EAN-13 | The 13-digit retail symbol used almost everywhere outside North America | Your national GS1 member organisation |
| UPC-A | The 12-digit retail symbol used in the US and Canada | GS1 US |
| ASIN | Amazon's own catalogue ID — it identifies a listing, not your product | Amazon, automatically |
| FNSKU | Amazon's fulfilment label, stuck over your UPC on FBA units | Amazon, automatically |
| ISBN | Book identifier; ISBN-13 is an EAN-13 starting 978 or 979 | National ISBN agency |
For internal use — warehouse bins, sample kits, employee badges — none of this applies. Code 128 with your own numbering scheme is enough, and no GS1 membership is required.
India: the 890 prefix and why resold barcodes are a trap
GS1 India is the only body authorised to issue numbers beginning with 890, and that prefix is what Indian retail and marketplaces recognize. Amazon, Flipkart, Blinkit, Myntra and BigBasket list GS1-registered GTINs as a listing requirement. In 2026 the Delhi High Court restrained an overseas reseller from selling 890 numbers without GS1 India's authorisation. A cheap barcode bought from a reseller is not a licence to use that prefix, and the number can be withdrawn under you long after the packaging is printed.
Books: ISBN, and what KDP actually gives you
An ISBN-13 is an EAN-13 with a 978 or 979 prefix, which is why a book barcode looks like a grocery barcode — because it is one. In India, ISBNs are issued by the Raja Rammohun Roy National Agency under the Ministry of Education through isbn.gov.in. In the US, Bowker sells them. Amazon KDP generates the barcode from your ISBN at no charge, so paying a third party for a "book barcode" image is usually money for something you already have.
GS1 US pricing (indicative — confirm current fees)
| Number of products | Initial fee | Annual renewal |
|---|---|---|
| 1 GTIN (single product) | $30 one-time | $0 |
| 10 GTINs | $250 | $50/year |
| 100 GTINs | $750 | $150/year |
| 1,000 GTINs | $2,500 | $500/year |
| 10,000 GTINs | $6,500 | $1,300/year |
| 100,000 GTINs | $10,500 | $2,100/year |
A single GTIN at $30 with no annual fee is the cheapest route for a handful of products. A GS1 Company Prefix pays off once you pass roughly ten codes. Fees differ by country and change without notice — check the current schedule on the GS1 US site and on GS1 India before budgeting.
FBA: the label that gets covered
Amazon requires a valid UPC or EAN to create a listing, then applies its own FNSKU over your barcode on every unit it stores. The UPC is still mandatory — it is the key that ties the listing to a real product — but the symbol the warehouse actually scans is Amazon's. Printing elaborate UPC labels for FBA-bound cartons is wasted ink.
A generated image never grants the right to use a number in global retail. If it goes on a shelf or a marketplace, the number has to come from GS1 or the relevant ISBN agency.
PNG vs SVG and print
Choose the format for the next step in the workflow. Print jobs almost always want vector.
| Format | Best for | Watch out for |
|---|---|---|
| PNG | Web, email, Word and PDF embeds, on-screen previews | Raster: it has a fixed pixel width. Scaling up resamples the bars and softens the edges. |
| SVG | Labels, packaging, large format, anything going to a printer | Vector: it stays exact at any size, but some label software ignores quiet zones when you place it. |
For a PNG, print at about 300 DPI at the final label size. A 30 mm wide EAN-13 at 300 DPI is roughly 350 pixels across; at 150 DPI it is 175, and the narrow bar falls below reliability on most thermal printers.
Two print settings undo more good barcodes than any other cause. “Fit to page” rescales the symbol to fill the paper, and “shrink to fit” does it silently in some PDF viewers. Set scaling to 100% or Actual size every time, then check the printed width with a ruler before running the box.
The rest is stock and contrast: black bars on a light background, the minimum bar width for the symbology, quiet zones left intact, and the same scanner model your store or warehouse actually uses.
Avoid glossy film without testing it first — reflections confuse some scanners at some angles, which is the worst kind of failure because it works on your desk and not on the dock. Matte label stock is safer for high-volume use. On colored packaging, keep a solid light panel behind the barcode.
Bulk generation — from ten codes to ten thousand
Scale the method to the count. The tool that is pleasant for one code is painful for a thousand, and the reverse is also true.
The AFFLIGO Barcode Generator takes one value per line in its Batch tab, generates up to 50 at a time, and exports them as a ZIP of PNGs. That covers a product launch, a shelf relabel or a box of asset tags without touching a script.
Past a few hundred, move the data into a spreadsheet and let the registry and the barcode come from the same row. Libraries such as JsBarcode and BWIP.js render to canvas or SVG and are the sane choice for a one-off job; a dedicated label application earns its keep once the same label has to be reprinted every month.
Excel route: one code per row in column A, one product per row beside it. Paste the column into the Batch tab for a small run, or export CSV and feed it to a script for a large one. Barcode fonts are the third option and the riskiest — glyph rendering depends on point size, so a half-point change shifts the bars off specification while the cell still looks correct on screen.
Word and Avery route: mail-merge the spreadsheet into the label template, but merge the barcode image, not the number text. Print one merged page at 100% and scan it before committing to the sheet — merged fields are where quiet zones get cropped by the template margins.
Whatever the method, keep a registry: value, product, date assigned, owner. It prevents two teams inventing the same code six months apart, and it makes a reprint trivial. Put three known-good control labels in every bulk run: if the controls fail to scan, the fault is the printer, the media or the settings — not one bad number.
Why scans fail — the ranked list
Almost every failure is print or data, not software. Work down the table in order; the top rows are the ones that actually happen.
| Barcode problem | Likely cause | What to try |
|---|---|---|
| Scans on screen, dead in print | “Fit to page” or shrink-to-fit scaled the symbol down | Print at 100% / Actual size, then measure the printed width |
| Printer stretched the symbol | Non-uniform scaling in the label template or PDF export | Place the image at its natural size; never drag the corner handles |
| Scanner will not read | Low contrast, tiny size, missing quiet zone | Black on white, larger print, more margin |
| Wrong data after scan | Wrong type or invalid check digit | Match type to data; let tool compute check digit |
| Retail listing rejected | Number not GS1-owned | Obtain proper GTIN; do not invent retail codes |
| Blurry when enlarged | PNG scaled up too far | Export SVG for large labels; use 300 DPI minimum for PNG |
| Works on phone, fails on POS | Wrong symbology for that scanner | Confirm EAN/UPC vs Code 128; check scanner symbology settings |
| Red or colored bars won't scan | Color reflects red laser light | Use black, dark navy, or dark green bars on white background |
| White bars on black won't scan | Inverted reflectance confuses laser | Use black bars on white — never reverse the colors |
| Glossy label won't scan | Specular glare from shiny surface | Use matte label stock; or print white flood area behind barcode |
| Transparent label on colored bottle | Bottle color shows through as background | Print white underlay behind the barcode area |
| Bars look smeared or too wide | Ink bleed on absorbent paper | Use tighter stock; reduce bar width; try thermal transfer printer |
| Print resolution too low | Narrowest bar is only 1-2 dots wide | Use 300+ DPI printer; or export as SVG (vector, resolution-independent) |
| Scanner beeps but no data appears | Scanner not configured for that symbology | Enable the barcode type in scanner settings; check manufacturer config tool |
Privacy — the code never leaves the tab
An internal SKU list is more sensitive than a product photo. It is a map of your catalogue.
Many online generators post the value to a server and send an image back. For a marketing URL that is harmless. For warehouse codes, batch numbers and unpublished product lines, it means someone else now holds a copy of your inventory structure.
The AFFLIGO Barcode Generator renders in the browser with JavaScript. Nothing is uploaded, nothing is stored, there is no account, and the downloaded file carries no watermark or tracking metadata. Once the page has loaded it keeps working without a connection. The same applies across the site's privacy policy.
FAQ
The questions that actually come up after the first print run.
Retail checkout: EAN-13 outside North America, UPC-A in the US and Canada, both with a GS1-issued number. Internal tracking, shipping and asset tags: Code 128. Shipping cartons: ITF-14. Small packages: EAN-8. Code 39 only when a partner system still requires it. The full decision table is in section 4.
Only if the code goes on a product sold through retail or a marketplace, in which case you need a GS1-issued GTIN. For warehouse bins, assets or shipping labels you can use any numbering scheme you like with Code 128, and no membership is involved.
GTIN is the umbrella term for the product number. EAN-13 and UPC-A are two ways of printing it — 13 digits globally, 12 digits in North America. ASIN is Amazon's own catalogue ID and has nothing to do with your barcode; Amazon assigns it when the listing is created.
Phone cameras decode far more aggressively than a checkout laser. A pass on a phone proves the data and check digit are valid — not that the print is good enough for a laser. The usual culprits are a symbol scaled below its minimum X-dimension, a cropped quiet zone, or a symbology the till scanner was never configured to accept.
Below about 80% magnification, yes — the narrow bar drops under the minimum X-dimension for EAN and UPC, and most laser scanners stop trusting the read. Above 80% it is usually fine. The damage comes from “fit to page” scaling, which can land anywhere between 60% and 95% without telling you.
You can buy a resold prefix, but you do not own it, and it can be withdrawn. In India, GS1 India is the only body authorised to issue 890-prefix numbers, and a 2026 Delhi High Court order restrained an overseas reseller from selling them. Marketplaces check prefix ownership, so a cheap barcode usually fails at listing time rather than at the scanner.
EAN-13 bottoms out at 29.83 mm wide — 80% magnification — and Code 128 needs a narrow bar of at least 0.250 mm, which is 3 dots on a 300 DPI printer but 2 dots on a 203 DPI one. Height matters too: keep at least 15 mm for handheld scanning. The calculator in section 6 does the arithmetic for your own printer.
Key Takeaways
- A generator draws a number you already own. It cannot allocate a GTIN or verify that a number is yours.
- Code 128 for internal work, EAN-13 or UPC-A for retail, ITF-14 for cartons, EAN-8 for small packages.
- The minimum is set by the narrow bar. 0.264 mm for EAN/UPC, 0.250 mm for Code 128, 0.191 mm for Code 39.
- “Fit to page” is the most common cause of a barcode that dies in print but scans on screen.
- A phone pass proves the data is valid. It does not prove a laser till scanner will read the label.
- GS1 owns the number, the ISBN agency owns the book number, and Amazon's FNSKU covers whatever you print for FBA.
