Barcode generator and validator
Type the number and the page draws it: EAN-13, UPC-A or CODE-128. If the final digit is missing, the page computes it; if you supply a full number, it checks it and tells you when the digit is wrong instead of drawing something a scanner will reject.
You get two files. The SVG is vector, so it survives whatever size the print shop asks for without turning the bars into staircases. The PNG is already raster, ready to paste into a document, an email or a proof layout.
The other direction works too: paste a GTIN of 8, 12, 13 or 14 digits and press the check button to find out whether its last digit is the right one, with nothing drawn.
Nothing leaves the browser. The page calls no server, never uploads the number you type and keeps no history, so it still works if the connection drops after the page has loaded.
How to use
- Write the number in the field. EAN-13 takes 12 digits (the check digit is computed) or 13 (the last one is verified); UPC-A takes 11 or 12; CODE-128 takes text, not only digits.
- Pick the format in the list next to the field. The bars appear below immediately, with the human-readable number under them.
- Download the SVG for the print shop or the PNG for quick use. Both files carry exactly the same code.
- If all you want is to know whether a GTIN is well formed, type the digits and press “Check digit”: the page answers with the full number and the format that would draw it.
How the check digit is calculated
Walk the number from right to left, multiplying each digit by 3, 1, 3, 1…, add everything up, divide by 10 and take whatever is missing to reach the next multiple of 10. That remainder is the check digit, and the arithmetic is the same for all four GTIN lengths.
This is why a leading zero changes nothing: it adds nothing to the sum and shifts no weight. A 12-digit UPC-A is an EAN-13 with a zero in front of it — same bar widths, the same 95 modules.
CODE-128 does not use the GTIN digit at all: the symbol closes with its own control value, found by summing each symbol value times its position (1, 2, 3…) and taking the remainder of 103. The text itself is encoded as typed.
What this page does not do: it does not look up whether a company prefix exists in the GS1 register, because there is no key-free public source to ask; it does not promise a printed size, which depends on the module width and DPI of the file you download; and CODE-128 here takes printable text, with control characters only when Set A is in use.
| Number (without the digit) | Weighted sum | Check digit |
|---|---|---|
| EAN-13 590123412345 | 83 | 7 |
| UPC-A 03600029145 | 58 | 2 |
| EAN-8 9638507 | 86 | 4 |
| GTIN-14 1590123412345 | 86 | 4 |