webtools

Barcode Generator

Private: drawn on your device, never sent anywhere

Make a real, scannable EAN-13, UPC-A, EAN-8 or Code 128 barcode and take it away as SVG for print or PNG for a screen. The check digit is worked out for you, the quiet zones are built in, and the finished size is quoted in millimetres at 300 dpi so a label fits the first time.

About these barcodes

A barcode is not a picture of stripes, it is a number written in a code with rules about widths, parity and blank space. Get one rule wrong and the symbol still looks convincing on screen while no till in the country will read it. So this tool draws from the encoding tables in the standard, works out the check digit itself, and keeps the quiet zones inside the image where they cannot be cropped off by accident.

EAN-13 is the retail barcode on almost everything sold outside North America, and UPC-A is the twelve digit North American form of the same symbol, which is why a UPC-A here is encoded as an EAN-13 with a leading zero. EAN-8 exists for packages too small for thirteen digits. Code 128 is the logistics and internal label code: it carries letters, digits and punctuation rather than a fixed length number, and it packs runs of four or more digits two to a symbol so a long numeric label comes out close to half as wide. None of the four carries a link or a block of text: for that you want a QR code instead.

The output is SVG, because bars have to stay sharp at whatever size they are printed and a vector never blurs. The PNG is that same SVG drawn to a canvas at the exact pixel size shown, for a screen, a slide or a marketplace upload that will not take SVG.

How to make a barcode

  1. Pick the format. EAN-13 for retail, UPC-A for North America, EAN-8 for small packs, Code 128 for anything with letters.
  2. Type the number. Leave the check digit off and it is calculated for you; type it in and it is checked, and you are told the right one if it does not match.
  3. Set the module width, the width of the narrowest bar. Four pixels is 0.34 mm at 300 dpi, which is the nominal size of a retail barcode. Go below two only for a screen.
  4. Set the bar height. Taller is easier to scan at an angle, and a retail symbol is normally about 22 mm tall.
  5. Take it away: SVG to print or place in artwork, PNG for a screen, Copy for the SVG markup to paste straight into a page.
  6. Print it at 100 percent, on white, with nothing inside the blank margin either side, then scan it before you order a thousand labels.

Common questions about barcodes

What is the check digit and why does it change my number?

It is the last digit, and it is not free data: it is worked out from the others by weighting them 3 and 1 alternately and taking whatever reaches the next multiple of ten. That makes the barcode self checking, so a scanner that misreads one digit rejects the read instead of returning the wrong product. Type 12 digits for an EAN-13 and the 13th appears by itself. Type all 13 and it is verified, and if it is wrong you are told which digit it should have been.

Will these actually scan at the till?

The symbol is correct, the quiet zones are included and the check digit is valid, so yes, provided you print it properly: black on white, at 100 percent with no scaling in the print dialog, at 300 dpi or better, and with nothing printed in the blank margin either side. Test it with a phone scanner app before committing to a print run. Selling in a shop needs more than a valid symbol though, see the next answer.

Can I invent my own retail barcode number?

Not for a product you intend to sell through shops or marketplaces. Retail numbers come from a GS1 company prefix that is licensed to you, and a made up number may already belong to somebody else. Use this tool freely for internal labels, asset tags, stock control and testing, and buy a real prefix from GS1 before your product reaches a till.

What can Code 128 hold?

Printable ASCII, from space to tilde: letters in both cases, digits, and punctuation, with no fixed length. It cannot hold accented letters, currency symbols outside the ASCII range, emoji, tabs or line breaks, and it will tell you which character it choked on. Runs of four or more digits are automatically packed two digits per symbol, which is what the compact option does. Turn it off if a very old scanner in your warehouse mishandles the switch.

Why does EAN-13 show the first digit outside the bars?

Because it is not drawn as bars at all. An EAN-13 has room for only twelve encoded digits, so the thirteenth is carried in the pattern of the left hand six: each is drawn from one of two tables, and the sequence of choices spells out the first digit. That is why it sits to the left of the symbol in the printed number, and why the tall guard bars in the middle and at each end are part of the code rather than decoration.

Is my number uploaded anywhere?

No. The encoding tables and the drawing code are JavaScript on this page, so the barcode is built in your browser and the number never leaves your device. The page keeps working with your connection switched off, and the SVG and PNG are assembled locally too.

Next

Related tools

All Generators