All Tools

Barcode Generator, Code 128, EAN-13, UPC, Code 39

Make a barcode in your browser: Code 128, Code 39, EAN-13, EAN-8, UPC-A or ITF-14. Check digits are added and checked for you. Set bar width, height and colours, then download SVG or PNG. Nothing is uploaded.

Any ASCII text. The check symbol is added for you.

#000000
#ffffff

308 by 122 px.


About the Barcode Generator

The Barcode Generator draws a one-dimensional barcode from a value you type and lets you download it as an image. Choose a Barcode type (Code 128, Code 39, EAN-13, EAN-8, UPC-A or ITF-14), enter the Value, and the barcode updates as you type. Then press Copy SVG, Download SVG or Download PNG.

The barcode is drawn in your browser. The value you type and the image never leave your device. Nothing is uploaded, logged or stored, and the page works without a connection once it has loaded.

How to use it

Steps

  1. Pick the Barcode type that your scanner, label or system expects. Each type remembers its own Value, so you can switch back and forth.
  2. Type the Value. The hint under the box explains what that type accepts.
  3. Set Bar width, Height, Margin and the two colours, and use Show the text under the bars to show or hide the human-readable text.
  4. Press Download SVG for print, Download PNG for documents, or Copy SVG to paste the markup.

Which type to choose

Code 128

Takes any ASCII character, 0 to 127, and packs digits closely, so it is the usual choice for shipping labels, serial numbers and internal references. See the Code 128 Barcode Generator.

Code 39

Takes uppercase letters, digits, space and - . $ / + %. Lowercase is converted to uppercase, and the start and stop character * is added for you. An optional mod-43 check character is available with Add check character.

EAN-13, EAN-8 and UPC-A

The retail families. EAN-13 takes 12 or 13 digits, EAN-8 takes 7 or 8, and UPC-A takes 11 or 12. In each case the last digit is a check digit that the page adds or verifies. See the EAN-13 Barcode Generator.

ITF-14

Interleaved 2 of 5 for outer cartons and cases. It takes 13 or 14 digits and uses the same check digit rule.

The check digit

For EAN, UPC and ITF-14, the GS1 check digit is found by working from the rightmost data digit, giving digits alternating weights of 3, 1, 3, 1 and so on, and adding them up as SS:

c=(10−(S mod 10)) mod 10c = (10 - (S \bmod 10)) \bmod 10

If you give the page the data digits only, it adds the check digit and a note says "Check digit N is included" with the full number. If you give the full number and the check digit is wrong, an inline error names the right one.

Sizing and printing

Keep the Margin, the blank space at either end, because scanners need it to find the start of the bars. Keep Bar width at 2 px or more for on-screen use, print at 100% scale, and use dark bars on a light background. Always test with a real scanner before printing a batch. The SVG suits print and vector work, and the PNG suits documents; the Image Converter can change the PNG into another format.

What this tool does not do

A barcode image does not register a product. To sell in shops you need numbers licensed from GS1, and a number you invent can collide with a real product. Numbers made here are suitable for tests, for internal inventory and for labels where you control the numbering. GS1-128, EAN add-ons and two-dimensional codes are not covered; for square codes, use the QR Code Generator.

Frequently asked questions

Is my barcode value uploaded anywhere?

No. The barcode is drawn in your browser, so the value and the image are never sent, logged or stored.

Which barcode types can I make?

Code 128, Code 39, EAN-13, EAN-8, UPC-A and ITF-14. GS1-128, EAN add-ons and two-dimensional codes are not included; use the QR Code Generator for QR codes.

Should I download SVG or PNG?

Use SVG for printing and vector work, because it scales without losing sharpness. Use PNG for documents and slides. For printing, keep the scale at 100 percent.

Why does my barcode not scan?

Common causes are a margin that is too small, a bar width under 2 px on screen, low contrast between bars and background, or a print scaled to fit the page. Use dark bars on a light background, keep the blank margin and test with your scanner before printing a batch.

Why does the page show a wrong value error?

Each type has its own rules, shown in the hint under the Value box. For example, EAN-13 needs 12 or 13 digits, Code 39 rejects the asterisk, and Code 128 rejects characters outside ASCII. The message names the problem character or the correct check digit.

Can I use these barcodes to sell products in shops?

Only with numbers licensed from GS1. An image does not register a product, and a made-up EAN or UPC can match a real product. Numbers made here are fine for tests, internal inventory and labels where you control the numbering.

Other related tools