Barcode Generator

Type a product code or any text and get a scannable Code 128 or EAN-13 barcode, downloadable as vector SVG or a high-resolution PNG.

Runs in your browser. Your image is never uploaded.

How to use Barcode Generator — Code 128 and EAN-13, Free

  1. 1Pick the barcode format: Code 128 for any text, or EAN-13 for a product code.
  2. 2Type the value, then set the height, bar width and whether to print the text underneath.
  3. 3Download the barcode as SVG for print, or PNG for the web.

About Barcode Generator

Code 128 is the workhorse of internal barcodes. It carries the full printable ASCII range, which means an order reference like INV-00417/B goes in unchanged, and it is dense: a numeric mode packs two digits into one symbol, so a long stock number takes roughly half the width it would as letters. The encoder switches between text and numeric mode as it walks your string, appends the modulo-103 check symbol every scanner verifies, and terminates with the stop pattern — all of which happens here without you choosing anything. The one hard limit is the character set: anything outside ASCII 32 to 126, including accented letters and emoji, is rejected with a message rather than silently mangled into a code that scans as something else.

EAN-13 is a fixed structure rather than a free-form encoding, and it is worth knowing why the 13th digit exists twice over. The symbol is always 95 modules wide: a three-module start guard, six digits, a five-module centre guard, six more digits, and a three-module end guard. Only twelve of the thirteen digits are drawn as bars. The first digit is not drawn at all — it is encoded in which of two patterns each of the next six digits uses, so a scanner recovers it from the parity of the left half. The final digit is the check digit, derived from the other twelve by the 1-and-3 weighting the tool spells out on screen. That is why you can type twelve digits and get a complete, correct code back, and why pasting thirteen lets the tool verify rather than guess.

Getting a barcode to scan is mostly a printing problem, not an encoding one. Keep the quiet zone: the blank margin either side is part of the symbol, and cropping tight to the bars is the single most common reason a label fails to read. Print at a size where the narrowest bar survives your printer and your substrate, which for a thermal label usually means exporting the SVG and letting the label software scale the vector rather than stretching a small bitmap. Two honest limitations of the artwork produced here: the guard bars are drawn the same height as the data bars rather than extended below them, and the human-readable number is centred under the whole symbol instead of being split either side of the centre guard as it is on retail packaging. Scanners are indifferent to both, but a print house working to a GS1 artwork specification will want the traditional layout, so treat this as a working barcode rather than final retail packaging artwork.

Frequently asked questions

Which barcode types can this generate?
Two: Code 128 (any printable ASCII, characters 32 to 126) and EAN-13 (12 or 13 digits). A 12-digit UPC-A becomes a valid EAN-13 by adding a leading zero, so UPC-A codes work here too. It does not produce Code 39, ITF-14, Codabar, Data Matrix or PDF417, and it cannot build GS1-128 with FNC1 application identifiers — those need a symbology-specific escape this encoder does not emit. For QR codes, use the separate QR code generator.
How is the EAN-13 check digit calculated?
Take the first 12 digits left to right. Count the 1st, 3rd, 5th and so on once, and the 2nd, 4th, 6th and so on three times, then add them up. The check digit is whatever brings that total to the next multiple of ten. For 590123412345 the weighted total is 83, so the check digit is 7 and the full code is 5901234123457. The tool shows this arithmetic for whatever you type, and if you paste all 13 digits it tells you when the 13th disagrees with the calculated one.
Will the barcode I download actually scan?
Usually, if you keep it big enough and keep the blank margin. Two things decide it: module width — the width of the narrowest bar — and the quiet zone, the blank space either side. The default quiet zone here is 10 modules on each side; GS1 asks for 11 modules on the left and 7 on the right of an EAN-13, so 10 either side is close, and you can raise it to 30 if a scanner hesitates. On screen a 1px module is too thin to survive printing, so export the SVG, or a PNG at 4× or 8×, rather than screenshotting the preview.
Can I invent my own EAN-13 number?
You can generate one, and its check digit will be mathematically correct, but that does not make it yours. Retail EAN and UPC numbers are built on a company prefix allocated by GS1, and a made-up prefix may already belong to someone else — which is a real problem if the product goes into a shop. Made-up codes are fine for internal stock, labels and testing; for retail, get a registered prefix. This tool checks the maths, not the ownership.
Why does my Code 128 barcode get narrower when I type digits?
Code 128 has a numeric mode, set C, that packs two digits into a single symbol. The encoder switches into it for a run of four or more digits (six or more mid-string, where the switch has to pay for itself) and back out for letters or punctuation, so a purely numeric code comes out close to half the width of the same length in letters. The switching and the modulo-103 checksum are handled automatically.
SVG or PNG — which should I download?
SVG if anything downstream accepts it: it is vector, so it stays razor-sharp at any label size and the file is a few kilobytes. PNG for tools that will not take SVG, such as some label printers and marketplace listing forms. The PNG is rendered from exactly the SVG you see, at the scale you pick — an EAN-13 at the default settings is 230 × 106 pixels at 1×, and 1840 × 848 at 8×.