Saved

Press the star next to a tool's name to save it.

All my tools

Barcode Generator

Use this barcode generator to make Code 128, EAN-13, EAN-8, UPC-A, Code 39, ITF-14, MSI and Codabar barcodes. Check digits are worked out and checked for you, and you can download SVG or PNG. Nothing is sent anywhere.

px

EAN, UPC and ITF-14 numbers can be typed without their last digit. The check digit is added for you, or checked if you type it.

Everything happens in your browser. Your files and pictures never leave your device.

Your barcode

Type a number or text and press Generate barcode.

A barcode generator turns a number or a short text into a pattern of bars that a scanner can read. This one draws Code 128, EAN-13, EAN-8, UPC-A, Code 39, ITF-14, MSI and Codabar, checks the numbers for you, and lets you download the result as an SVG or a PNG. It works in your browser, so nothing you type is sent anywhere.

Use it for shelf labels, inventory tags, asset stickers, event passes or practice. Do not use it to invent product numbers for a shop. Retail numbers are assigned by GS1, and a number you make up could belong to someone else.

How this barcode generator works

You choose a type, type the value and press Generate barcode. The picture is drawn by JsBarcode, a JavaScript library that can write barcodes as SVG or canvas pictures. [6] Before drawing, the page checks the length and characters for the type, and works out the check digit for the number types.

Choosing the barcode type

TypeHoldsTypical use
Code 128All 128 ASCII characters; pairs of digits packed tightly [1]Shipping, general labels
EAN-13 and EAN-813 or 8 digits [2]Retail products worldwide
UPC-A12 digits [3]Retail products, mainly North America
Code 3943 characters: A to Z, 0 to 9 and - . $ / + % and space [4]Industrial and asset tags
ITF-1414 digits for cartons [5]Outer cases and cartons
CodabarDigits, - $ : / . + and start and stop letters A to DLibraries, blood banks
MSIDigits onlyInventory and shelf labels

How the check digit works

For EAN-13, EAN-8, UPC-A and ITF-14, the last digit is a check digit. Each digit of the number is multiplied by 3 or 1, alternating and starting with 3 at the right of the number without its check digit. The sum is taken to the next multiple of 10, and the difference is the check digit. [2] For 400638133393 the sum is 89, so the check digit is 1 and the EAN-13 is 4006381333931. [2] For 036000291452, the UPC-A example, the last digit 2 comes from the same idea. [3]

If you type the number without its last digit, the tool adds it. If you type the whole number, the tool checks it and tells you the right digit when it is wrong. This catches typing slips before the label is printed.

Step by step

  1. Pick the barcode type.
  2. Type the number or text. The box shows an example for the type you picked.
  3. Choose a bar width and height, and tick or untick the box that prints the number under the bars.
  4. Press Generate barcode, then download the SVG for printing at any size or the PNG for documents and screens.

Reading the result table

Below the picture you see the type, the exact value that was encoded and the check digit. For number types the encoded value can be longer than what you typed, because the check digit has been added. Copy the encoded value if you need to record it in a spreadsheet or inventory system, so that the database matches the label exactly.

Choosing size and bar width

Bar width sets how thick the thinnest bar is, in pixels on screen. Wider bars are easier for cheap scanners and low-resolution printers to read. Bar height matters less for most scanners, but tall bars help when a label is scanned by hand at an angle. For small labels, pick the Code 128 type, which needs less width than Code 39 for the same text, and print at a size where the thinnest bar is at least a few printer dots wide.

Common uses

  • Inventory and stock rooms: label shelves and boxes with Code 128 or Code 39.
  • Events: print a ticket number as Code 128 and scan it at the door.
  • Libraries and clubs: Codabar and Code 39 are still common in older systems.
  • Warehouses: ITF-14 on outer cartons when you already own a valid GTIN.
  • Learning and testing: try different types and see how the bars change.

Printing tips

  • Leave blank space on both sides of the bars. The picture includes a margin; do not crop it.
  • Print dark bars on a light background, and avoid colors that are low in contrast.
  • SVG stays sharp at any size. Use PNG for word processors and slides.
  • Code 39 and Codabar are wider than Code 128 for the same text, so check the label size first.
  • Always scan a test print with the scanner or phone app you will use.

Why a barcode may not scan

The usual causes are bars that are too thin for the printer, a dark or patterned background, a barcode that is stretched, and a number that does not match the type. Make bars wider, print larger and make sure the type matches the system that will read the code. A barcode only stores a value. Prices and product names are kept in a database elsewhere.

A note on formats

Code 128 is defined in ISO/IEC 15417 and uses a check symbol that is added automatically by the drawing library, so you never type it. Code 39 and Codabar are self-checking in their own way, and MSI has several optional check schemes that this page does not add. If your system asks for a particular check scheme, add the digit to the text before you generate the barcode. [1] [4]

This tool is not affiliated with GS1.

What next

Use this often? Add Barcode to your Home screen.

Frequently asked questions

What is the best barcode generator type for plain text?

Code 128. It can hold all standard keyboard characters and packs digits tightly. Use Code 39 only if an older system asks for it.

Does the barcode generator add the check digit?

Yes, for EAN-13, EAN-8, UPC-A and ITF-14, when you type the number without its last digit. If you type it, the digit is checked instead.

Can I use these barcodes in a shop?

Only with numbers assigned to you by GS1 or your national GS1 office. A generator cannot give you a valid product number.

Is my text sent to a server?

No. The barcode is drawn in your browser and downloaded from your own device.

Should I download SVG or PNG?

SVG is best for printing, because it stays sharp at any size. PNG is easier to paste into documents and slides.

Why does my EAN-13 get rejected?

It must have 12 or 13 digits, and a typed 13th digit must match the check digit worked out from the first 12. The message shows the digit it expects.

What went wrong?

We only receive the reason you pick, never what you typed into the tool.

Thanks for your feedback.

More Image Tools