The quick answer: pick the format, type the number, test the print
You need a barcode for a shelf label, a product or a box, and it must scan first time. For your own labels, use Code 128 in the barcode generator. For something sold in shops the format is EAN-13 or UPC-A, and the number has to come from GS1, not from a generator.
- Pick the format by job: Code 128 for your own labels, EAN-13 or UPC-A for shop products, EAN-8 for very small packs, ITF-14 for outer cartons.
- Type the number. For EAN, UPC and ITF-14, leave off the last digit and the tool adds it. A full number you type is checked.
- Keep dark bars on a light background and leave the blank border.
- Download the SVG for print, print one copy and test it with a scanner first.
Which format for which job
| Format | Holds | Typical job | Check digit |
|---|---|---|---|
| Code 128 | Letters, digits, punctuation, up to 100 characters here | Your own labels: order numbers, asset tags, shipping | Built in |
| Code 39 | Capitals, digits and - . space $ / + %, up to 50 characters here | ID badges, parts bins, older inventory systems | Optional |
| EAN-13 | 13 digits | Products sold in shops in most of the world | Last digit |
| UPC-A | 12 digits | Products in the United States and Canada | Last digit |
| EAN-8 | 8 digits | Packages too small for an EAN-13 | Last digit |
| ITF-14 | 14 digits | Outer cartons that hold several products | Last digit |
The format pages open with the choice made: Code 128, Code 39, EAN-13 and UPC-A. For your own ID on a label, Code 128 is the usual answer: it is compact, most scanners read it out of the box, and there is no registry or license. Accented letters and emoji do not fit in the Code 128 barcodes made here, so use a QR code for those.
The check digit, and what the tool does about it
The last digit of an EAN, UPC or ITF-14 number is worked out from the others. The scanner repeats the sum and discards the read if the digit does not match, so a misread digit does not become a wrong product.
From the right, give the digits the weights 3, 1, 3, 1 and so on, add the results, and the check digit is what brings the total up to the next multiple of 10. For the EAN-13 number 590123412345, the weighted digits from the right add up to 15 + 4 + 9 + 2 + 3 + 4 + 9 + 2 + 3 + 0 + 27 + 5 = 83. The next multiple of 10 is 90, so the check digit is 7 and the full number is 5901234123457.
- Type it without the last digit and the tool adds it. Type all of it and the tool checks it: 5901234123458 is flagged with 7 as the right last digit and a one click fix.
- Code 128 has its own check character inside the bars. Code 39 has an optional one that is off by default, because many scanners pass it to your software as an extra character.
The check catches any single wrong digit, and any swap of neighboring digits except those that differ by exactly 5, such as 0 and 5. It proves only that the digits are consistent, not that the number is yours.
Who issues retail numbers, and what a generator cannot do
Shop numbers are managed by GS1. A business licenses a company prefix and numbers its own products under it, which is how two shops scan the same box and find the same product. A generator only draws the barcode for the number you give it. A generated barcode is not a registered product number, and a number you invent can match one that belongs to another business.
- The first digits of an EAN-13 show which GS1 office issued the prefix, not where the product was made.
- 978 and most 979 numbers are book ISBNs, 977 is used for magazines, and numbers starting with 2 are meant for use inside one store or company.
- A UPC-A is an EAN-13 with a 0 in front, drawn with the same bars. Some buyers still ask for one or the other, so ask yours.
For stock inside your own warehouse, make your own numbers and use Code 128. For products sold through shops or marketplaces, ask which numbers they accept and get them from GS1 or its office in your country.
Print size, blank border and contrast
A scanner finds a barcode's start and end by the blank space beside it, counted in widths of the thinnest bar. Code 128, Code 39 and ITF-14 need 10 on each side, EAN-13 needs 11 on the left and 7 on the right, UPC-A 9 on each side and EAN-8 7. The tool warns when your border is smaller.
For shop products GS1 gives 0.33 mm as the normal width of the thinnest bar and allows 80% to 200% of that. An EAN-13 or UPC-A is 95 bars wide, so:
| Size | Bar width | The 95 bars span |
|---|---|---|
| 80%, the smallest allowed | 0.264 mm | about 25 mm |
| 100% | 0.33 mm | about 31 mm, or about 37 mm with the smallest blank border |
| 200%, the largest allowed | 0.66 mm | about 63 mm |
- Dark bars on a light background. Many shop scanners use red light, so red or orange bars can look like blank paper. Light bars on dark are not readable by most scanners.
- Print from the SVG. A PNG that is shrunk or printed small blurs thin bars, and a lossy JPG copy can too (JPG vs PNG vs WebP vs AVIF explains why). Never stretch the picture in only one direction, which changes the bar widths.
- Keep the digits and the border. Glossy paper adds glare, and some older laser scanners struggle with screens, so test with the scanner that will really be used.
Test it before you print a hundred
The generator has a Test scan button that reads the barcode back with a decoder in your browser. Treat a pass as a first check, because a failed read is not proof that a barcode is bad and a pass does not replace a real scanner. Then print one copy at the final size on the final material and read it with the barcode scanner, from a picture or the camera. It names the format and, for products, confirms the check digit, but does not look the product up. An extra character at the end of a scan is usually the scanner adding an Enter or Tab key press, not part of the barcode.
Three ways it goes wrong
- The number is invalid or not yours. A wrong last digit will not scan, and a valid made-up number can clash with a real one. Fix: let the tool add the check digit, and get shop numbers from GS1.
- It is printed badly. No blank border, bars blurred by shrinking, low contrast or a stretched picture. Fix: print from the SVG with the full border.
- The format is not what the system reads. A shop checkout expects EAN-13 or UPC-A numbers, not Code 128, and a scanner with a format switched off ignores it. Fix: ask the buyer or check the scanner's settings.
A barcode holds a number for a scanner at a till or in a warehouse. A QR code holds links and Wi-Fi details for a phone. Make a QR code that keeps working covers that job, and is that QR code safe covers reading one you did not make.