Generate a barcode
Everyday tools
Enter a number and get a barcode. The check digit is worked out for you, and the result is an SVG that scales without blurring.
Runs in your browser
Nothing is uploaded. The work happens on your own device, so your file or text never reaches us.
About this tool
The check digit, and why a wrong one is dangerous
The last digit of an EAN or UPC is calculated from the others: each digit is weighted 3 or 1 alternately from the right, summed, and the check digit is whatever makes the total a multiple of ten.
Here is the part that matters. A barcode with the wrong check digit still scans — it simply reads as a different number. Nothing complains, nothing looks broken, and nobody finds out until a shipment is rejected or the wrong product rings up. So leave the digit off and let it be calculated; if you enter a full code, it is verified and refused if it does not add up.
Which one to use
EAN-13 is retail outside North America and, increasingly, inside it. UPC-A is North American retail — and is the same symbology: a UPC-A is an EAN-13 whose first digit is zero, which is why a European scanner reports thirteen digits where an American one reports twelve.
EAN-8 is for packages too small for a full EAN-13. It is not a shortened EAN-13: the numbers are allocated separately, and you cannot make one from the other.
Code 128 is for logistics and internal labelling. It takes letters as well as digits, has no fixed length, and packs runs of digits two to a symbol — which makes it the narrowest of the four for a long number.
Printing one that reads
Take the SVG and let the printer scale it. A bitmap enlarged to fit a label is the usual reason a barcode fails, exactly as with QR codes.
Keep the blank margin either side — retail asks for ten narrow bars’ worth — and do not squeeze the width to make it fit. A scanner measures the ratios between bars, so a horizontally compressed barcode is not a smaller barcode, it is a broken one. Making it shorter is fine; making it narrower is not.
Getting a number you are allowed to use
A barcode is only a way of writing a number. For a product sold in shops the number itself has to be allocated to you, by GS1 in your country, and a code you invent may already belong to somebody else.
For anything internal — asset tags, shelf labels, your own warehouse — invent whatever you like, and Code 128 is usually the better choice because it takes letters and has no allocation to worry about.