Skip to content

Barcode generator

Make Code 128, EAN-13, UPC-A, Code 39, ITF-14 and Codabar barcodes as PNG or print-ready SVG, with the check digit worked out for you.

Code 128 if you are not sure — it takes any text and is the most compact. The retail types accept digits only and have a fixed length.
The single number that decides whether a printed barcode scans. 0.33 mm is a safe general value; below 0.19 mm needs a good printer and a good scanner.
Taller is easier to scan at an angle. The standards ask for at least 15% of the barcode's width.
Only used for PNG. 300 is right for printing; 600 for very small bar widths.
Runs in your browser — nothing is sent anywhere.

The one number that decides whether it works

A barcode generator that offers you a size in pixels has told you nothing useful. What determines whether a printed barcode reads is the X-dimension — the width of the narrowest bar, in millimetres. Everything else follows from it.

This is the reason so many downloaded barcodes fail. You get a 300-pixel PNG, drop it into a Word document, drag it to fit a label, and the narrow bars end up a tenth of a millimetre wide. The image looks fine on screen. The scanner cannot resolve it. Nothing in the process told you the size had changed, because the file never carried a real-world size in the first place.

So the bar width is the main control here, it is stated in millimetres, and the printed dimensions are shown before you download. The SVG carries those millimetres in the file, which means it prints at the size you asked for rather than at whatever the importing application guesses.

The quiet zone is included, and it is not optional

Every one-dimensional symbology requires blank space either side of the bars — ten times the bar width for most, and for EAN-13 an asymmetric eleven modules on the left and seven on the right. A scanner uses it to establish where the symbol begins and what white looks like.

Being straight about how much this matters: a software decoder reading a clean image will often manage without it. We checked, and ZXing read every symbology here with the quiet zone stripped to nothing. Hardware scanners on printed labels are the ones that fail, and they fail intermittently rather than outright, which is the worst way for a label run to be wrong. The standards require the space; that is reason enough to include it.

Plenty of generators trim tight to the first and last bar because it looks neater. This includes the quiet zone, states how wide it is in millimetres, and counts it in the printed size — which is also why an EAN-13 here comes out at exactly the 37.29 mm the standard publishes, rather than the 38.61 mm you get from putting eleven modules on both sides.

Check digits, worked out and checked

EAN-13, EAN-8, UPC-A and ITF-14 all end in a check digit derived from the digits before it. Enter the number without it and it is calculated. Enter the full number and it is verified.

That second case is the one worth having. If the check digit you typed does not match, something earlier in the number is almost certainly wrong — and a barcode with a plausible but incorrect number does not fail loudly, it scans as another company's product. So a mismatch is called out rather than quietly overwritten.

The Code 39 check character works differently: it is optional in the standard, so it is a switch rather than automatic. Turn it on only if the system you are printing for asks for modulo 43.

Which one to pick

Code 128 if you are not sure. It encodes any ASCII text, it is the most compact of the general-purpose symbologies, and it is what asset tags, shipping labels and internal tracking numbers normally use.

EAN-13 for retail products anywhere in the world, UPC-A for the United States and Canada, EAN-8 where the package is too small for thirteen digits. These three need a number issued to you by GS1 — a generator cannot invent a valid product code, and one you make up will collide with a real product.

ITF-14 for shipping cartons, Code 39 where an older scanner or a government system demands it, Codabar for libraries, blood banks and courier airbills.

It runs in this page

The strings people put into a barcode generator are serial numbers, asset tags, case references, patient identifiers and unreleased product codes. None of that should cross the internet to have a table looked up, so none of it does — the encoding and the drawing both happen in your browser, and there is no upload step to wait for either.

One value per line makes a batch, returned as a zip, which is the case that matters when you are labelling a shelf of stock rather than one box.

How the tables were checked

Code 128 assigns 106 arbitrary bar patterns, and a single transposed row produces a barcode that scans cleanly as the wrong character — the worst kind of bug, because it looks like it works. Writing that table from memory put four rows wrong.

So the tests decode what this produces, using a reader written from the bar widths rather than from the encoder, and check the result against the input. That matters more than comparing against an existing library: the library we checked against silently drops two digits from every even-length all-digit Code 128 payload — thirty nines come out as twenty-eight — and computes a valid check digit over the truncated number, so nothing downstream notices. Comparing outputs would have made us reproduce that. Decoding caught it.

What is not here

The two-dimensional symbologies other than QR: no DataMatrix, PDF417 or Aztec. Each needs Reed-Solomon error correction and its own layout rules, and a half-implemented one is worse than none. QR codes have their own tool.

01

Common questions

What bar width should I use?

0.33 mm suits most labels and desktop printers. EAN, UPC and their relatives are specified down to 0.264 mm and ITF-14 to 0.495 mm; below those you are outside the standard and should test with the actual scanner first.

Why will my printed barcode not scan?

Almost always the bar width. If the image was resized after export the bars may now be too narrow for the scanner to resolve. Download the SVG, which carries its real size in millimetres, and place it without resizing.

Do I need to include the check digit?

No — leave it off and it is calculated. If you do include it, it gets verified, and you are told when it does not match, because that usually means an earlier digit is wrong.

Can I make up an EAN-13 or UPC number?

You can generate the barcode, but the number has to be issued to you by GS1 to be usable in retail. An invented one will already belong to another company.

SVG or PNG?

SVG for anything printed — it is correct at any size and carries its dimensions in millimetres. PNG only where something will not accept vector artwork, and then at 300 dpi or more.

Are my numbers uploaded?

No. The encoding and drawing happen in this page. Serial numbers and internal codes are exactly the sort of thing that should not leave your machine to have a lookup table consulted.

Can I make a lot at once?

Yes — one value per line and they come back as a zip, named after each value. Lines that encode to the same value get numbered so none are lost.