About Barcode Generator
Most barcode jobs come down to two formats. Code 128 is the workhorse for shipping labels, asset tags and internal stock, and it holds letters, digits and symbols. EAN-13 is the 13-digit number printed on retail products around the world. Pick one, type the value, and download a file you can drop into a label template.
The fiddly parts are done for you. EAN-13 needs a correct check digit, and Code 128 needs a check value and the right code sets. Both need blank margins so scanners can find the start. The margins are part of the image, so a file cropped by your label software is the only way to lose them.
How it works
For Code 128, the encoder uses dynamic programming to choose among code sets A, B and C with the fewest symbols. Set C packs two digits into each symbol, so a long run of digits comes out much narrower than the same run in set B. The check value is then added, followed by the stop pattern. Each file gets a quiet zone of 10 modules on both sides.
For EAN-13, enter 12 digits and the check digit is calculated. Enter all 13 and the last one is checked, and a wrong one produces an error telling you what it should be. An EAN-13 symbol is always 95 modules wide, with a quiet zone of 11 modules on the left and 7 on the right. The Width at 100% figure uses the nominal 0.33 mm module.
How to use Barcode Generator
- Under Barcode type, choose Code 128 or EAN-13.
- Type your value in the box, or press Try an example. The barcode appears as you type.
- Set Bar width and Bar height, and untick Show the number under the bars if your label prints the number elsewhere.
- Press Download PNG or Download SVG.
Two real runs
EAN-13: 400638133393
Code 128: ASSET-004217EAN-13
Full number: 4006381333931
Check digit added: 1
Width: 95 modules
Width at 100%: 37.3 mm
Code 128
Encoded: 12 characters
Check value: 58
Width: 145 modules
Symbols: 13Typing 4006381333932 for the EAN instead gives this error: The last digit should be 1, not 2, so this number is mistyped or not a real EAN-13.
When it helps
- Asset tags for laptops and equipment, using your own numbering in Code 128
- Shipping or bin labels in a small warehouse that uses hand scanners
- Library, membership or ticket cards that hold a short ID
- A retail product barcode, once GS1 has issued you a number
- Checking an EAN-13 you were given, by entering all 13 digits and seeing whether it passes
Tips for a better result
- Use SVG for label design software, since it scales without blurring. A PNG is drawn with whole pixels per module, so choose a bar width that suits your printer.
- Leave the white margins alone when placing the file. A scanner needs that gap, and a border or text placed too close is a common reason a barcode fails.
- Print a sample at final size and try it with the real scanner before running a batch.
- Keep Code 128 values short. Every extra character widens the symbol, and a wide code may not fit the label at a size that still scans.
Good to know
- Only Code 128 and EAN-13 are offered. There is no UPC-A, Code 39, ITF-14 or DataMatrix.
- Code 128 here covers ASCII only. An accented letter such as é is refused with a message, because extended characters are handled inconsistently by scanners. A QR code can hold any text.
- This tool does not issue product numbers. An EAN-13 you invent has a valid check digit but may clash with a real product, and shops generally expect a number assigned through GS1.
- It cannot grade print quality. Only a scan test or a barcode verifier can tell you whether your printed result meets a retailer's specification.
Questions people ask
Can I make up my own EAN-13 number?
You can generate one, and scanners will read it, but it is not yours. To sell through retailers you need a number from GS1, the body that assigns them. For anything internal, use Code 128 and your own IDs instead.
What does the check digit do?
It catches misreads and typing errors. The last digit of an EAN-13 is calculated from the first 12, and a scanner rejects any number where the sum does not come out right.
Why is my Code 128 barcode so wide?
Width grows with the number of characters. Digits take up less room because pairs share a symbol, so 0123456789012 uses 123 modules while the 12-character ASSET-004217 uses 145.
Which is better, the PNG or the SVG?
SVG is better for print, as it is made of exact rectangles. PNG suits office documents and on-screen use. In either case, avoid stretching the image unevenly, which changes the bar ratios.
What to use next
- QR Code Generator: when you need more data, accents or a link in the code
- QR Code Reader: if you also have QR codes to check
- Invoice Generator: if the items you label also need billing
Last reviewed . Read our editorial policy.