Barcode Generator (EAN-13, UPC-A, Code 128)
Create a printable barcode in your browser. Pick a symbology, type your value, and get a sharp SVG with the correct guard bars and check digit — nothing is uploaded.
How this barcode generator works
Every barcode is just a run of black bars and white spaces of different widths. A scanner measures those widths and turns them back into characters. This tool builds that pattern for you from a plain text or numeric value and paints it as an SVG vector — so the image never blurs, no matter how big you print it. The whole thing runs on your device with standard, published algorithms; there is no server call, no account and no watermark.
EAN-13 and UPC-A: retail product codes
EAN-13 encodes exactly 13 digits and is the barcode you see on almost every grocery item outside North America. Its layout is fixed and worth understanding, because the tiny guard bars are what make a scan reliable:
- Start guard — the pattern
101(bar, space, bar). - Left half — six digits, each drawn as 7 modules.
- Centre guard —
01010, the taller pair of lines in the middle. - Right half — six more digits, again 7 modules each.
- End guard —
101again.
That adds up to 95 modules. The clever part is the first digit: it is never drawn as bars of its own. Instead it is hidden in the parity of the six left-hand digits. Each of those digits can be encoded with one of two 7-bit tables — the odd-parity L-code or the even-parity G-code — and the sequence of L's and G's spells out the first digit. The six right-hand digits all use a third table, the R-code, which is simply the bitwise inverse of the L-code and always starts with a bar. This L/G/R scheme lets a scanner read the code in either direction and still know which way is up.
Because the last digit is a Mod-10 check digit, this generator will finish an incomplete code for you: type 12 digits for EAN-13 (or 11 for UPC-A) and it computes the missing check digit before drawing. Paste a full code and it verifies the check digit first, so you never print a barcode that a till would reject. UPC-A is really just an EAN-13 whose first digit is 0, which is why the two share the same 95-module structure and the same check-digit maths.
Code 128-B: text, logistics and internal codes
When you need to encode letters, punctuation or a serial number rather than a licensed retail number, Code 128 is the workhorse. This tool implements subset B, which covers all standard ASCII characters from space through lowercase z. Each character maps to a value, and each value is drawn as a symbol 11 modules wide built from three bars and three spaces. The encoding always begins with a Start-B symbol (value 104) and ends with a Stop symbol plus a final termination bar.
Code 128 protects itself with a modulo-103 checksum. The generator starts a running total at 104 (the Start-B value), then adds each character's value multiplied by its position (1, 2, 3, …), takes the remainder modulo 103, and inserts that symbol just before the Stop. That single check symbol is what lets a scanner reject a smudged or misread label instead of handing your system garbage.
Quiet zones and printing
The blank margin on each side of the bars — the quiet zone — is part of the symbol, not decoration. Scanners need it to find where the code begins and ends, so the SVG this tool produces includes a generous quiet zone on both sides. Keep it: do not crop tight to the first bar. Print in solid black on a white background, avoid stretching the image in only one direction, and because the output is a vector you can resize it freely without the bars losing their exact proportions.
FAQ
Can I print the barcode I generate here?
Yes. The barcode is rendered as an SVG vector, so it stays razor sharp at any print size. Download it and drop it into your label, packaging or spreadsheet artwork — never scale a bitmap, always use the SVG so the bars keep their exact module widths.
What do I enter for EAN-13 if I only have 12 digits?
Enter the 12 digits and the generator computes the 13th (check) digit for you with the GS1 Mod-10 formula, then draws the full EAN-13. If you already have all 13 digits it validates the check digit before drawing.
Which symbology should I pick — EAN-13, UPC-A or Code 128?
Use EAN-13 for retail products sold outside North America, UPC-A for US and Canadian retail, and Code 128-B for internal codes, logistics labels, serial numbers or any alphanumeric string that is not a licensed GTIN.
Generating barcodes in bulk?
Validate a whole catalog with the bulk validator, or wire check-digit and GTIN logic straight into your system with our pay-per-use API — first 25 calls each month are free.
Barcodes are drawn with the published EAN/UPC (GS1) and Code 128 standards. This tool does not assign or verify GS1 prefix ownership — the number you encode must be one you are licensed to use.