Barcode Generator
Type text for a Code 128 barcode, or 12 digits for EAN-13 (11 for UPC-A) and the check digit is calculated for you. The barcode is drawn in your browser and can be downloaded as a sharp SVG for print or a PNG image.
Which barcode for which job
| Type | Encodes | Use it for |
|---|---|---|
| Code 128 | Letters, digits, symbols (printable ASCII) | Inventory, asset tags, shipping and order references, library and ID cards |
| EAN-13 | 13 digits, last one a check digit | Retail products sold outside the US and Canada (number licensed from GS1) |
| UPC-A | 12 digits, last one a check digit | Retail products in the US and Canada (number licensed from GS1) |
Worked example: an EAN-13 check digit
First 12 digits: 4 0 0 6 3 8 1 3 3 3 9 3
weights from the left: 1 3 1 3 1 3 1 3 1 3 1 3
4 + 0 + 0 + 18 + 3 + 24 + 1 + 9 + 3 + 9 + 9 + 9 = 89
next multiple of 10 is 90 → check digit = 90 − 89 = 1
full number: 4006381333931
A scanner does the same sum on all 13 digits; if the total is not a multiple of 10, it rejects the read. That is why a single misread bar almost never produces a wrong product number.
Printing barcodes that scan
- Keep the quiet zone. The blank margin either side of the bars is part of the symbol. The generator includes it - do not crop it off.
- Dark bars, light background. Black on white is safest. Red bars are invisible to many laser scanners.
- Do not squash it. Scale width and height together, and prefer the SVG for print so the bars stay sharp.
- Test before you print 500. Scan a test print with a phone app or the scanner you will use.
How it is drawn: the text is converted to symbol values (Code 128 switches to its compact digit mode for long runs of numbers), a check value is added, and each value is turned into its published pattern of bars and spaces. Everything happens in your browser.
What this calculator does not do
- Code 128, EAN-13 and UPC-A only - no QR codes (use the QR code generator), Code 39 or ITF-14.
- Code 128 here accepts printable ASCII characters only, up to 80.
- It does not issue or register product numbers; retail numbers come from GS1.
Frequently asked questions
Which barcode type should I use?
Use Code 128 for your own labels, inventory, asset tags and shipping references - it encodes letters, numbers and symbols. Use EAN-13 (or UPC-A in the US and Canada) only for retail products, with a number issued to you.
Can I make up an EAN-13 or UPC number for a product?
No. Retail barcodes must use a company prefix licensed from GS1, the organisation that issues product numbers, or retailers and marketplaces may reject them. This tool draws the barcode for a number you already have; it does not issue numbers.
How is the check digit calculated?
Starting from the right of the first 12 digits (11 for UPC-A), multiply the digits alternately by 3 and 1, add them up, and the check digit is whatever brings the total to the next multiple of 10. For 400638133393 the total is 89, so the check digit is 1.
SVG or PNG?
SVG is a vector file that stays perfectly sharp at any size - best for printing and design software. PNG is an image at a fixed resolution, handy for documents and websites. For print, use SVG or a large PNG.
Will my barcode scan?
The bars follow the published symbol specifications, but scanning also depends on printing: keep the quiet margin either side, print dark bars on a light background, and do not shrink it too much. Test it with a scanner or phone app before printing in bulk.
Related free tools
▩
QR Code GeneratorCreate QR codes for URLs and text
🧾Invoice GeneratorCreate professional, modern invoices — pick a template, customise everything, download a clean PDF. AI auto-fill from a sentence.
🔠Case ConverterUPPER, lower, Sentence, Title, camelCase, snake_case, kebab-case and more.
⏱️Hours CalculatorWeekly time card with breaks and pay, time sums and time between two times.
Step-by-step guide: How to make a barcode →