Barcode generator

Code 128, EAN-13, EAN-8, UPC-A, Code 39 and ITF-14 as PNG or SVG.

Letters, digits and symbols from the basic ASCII set (no accents).

3 px
0 px
Barcode
Barcode for ABC-123456

123 modules

What this tool does

Type a number or a short text, pick the barcode type and you get a finished barcode that you can download as a PNG picture or as an SVG file. For the retail types the tool works out the check digit for you, and if you type a complete number it checks the last digit and tells you what it should have been. Everything is drawn in your browser, so nothing you type leaves your device.

A barcode does not hold a name or a price. It holds a short code, and the system that scans it looks the code up in a database. That is why the same barcode can be read by any scanner, and why the number you encode matters more than the picture.

Choosing the type

  • EAN-13 is the standard retail barcode used on products in most of the world. It encodes 13 digits.
  • UPC-A is the 12-digit version used in the United States and Canada. A UPC-A is the same as an EAN-13 with a leading zero.
  • EAN-8 is a shorter, 8-digit code for packages too small for an EAN-13.
  • ITF-14 encodes the 14-digit trade number printed on cartons and cases, and is drawn with a frame, called bearer bars, around it.
  • Code 128 encodes any text made of basic ASCII characters. It is compact and the usual choice for shipping labels, asset tags, order numbers and internal stock codes. The tool switches between its three character sets automatically, so runs of digits are packed two to a symbol.
  • Code 39 encodes capital letters, digits and a few symbols. It is older and wider than Code 128 but is still required by some systems.

How to use it

  1. Choose the type. The line under the field says what it takes.
  2. Type the content, or press "Use an example".
  3. For EAN-13, EAN-8, UPC-A and ITF-14, type the digits without the last one and the check digit is added; or type all of them and it is verified.
  4. Adjust the bar width, the height, the margin and the colours. Keep dark bars on a light background.
  5. Download the PNG for documents and screens, or the SVG for printing, because SVG stays sharp at any size.

A worked example: the check digit

Take the EAN-13 4006381333931. The last digit is the check digit. To work it out from the first twelve digits, 4 0 0 6 3 8 1 3 3 3 9 3, multiply the digits alternately by 1 and 3, starting with 1 on the left: 4, 0, 0, 18, 3, 24, 1, 9, 3, 9, 9, 9. These add up to 89. The check digit is whatever brings the sum up to the next multiple of 10, which is 1, because 89 plus 1 is 90. If anyone mistypes one digit, the sum no longer works out, and the scanner rejects the code instead of reading a wrong product.

Every barcode needs an empty margin on both sides, called the quiet zone, and the tool always includes the minimum its type requires. Do not crop it. Keep the bars dark on a light background with strong contrast; light bars on a dark background are not read by many scanners. Never stretch a barcode on one axis, which changes the widths. For retail EAN codes, the nominal bar width is 0.33 mm and the code may be scaled between 80 and 200 percent. Whatever you print, scan it with the actual scanner before you print a thousand labels.

Common mistakes

  • Making up product numbers. A number you invent for something sold through shops or online marketplaces can clash with someone else's, and many sellers require numbers issued by GS1. For internal use, any number is fine.
  • Using accents in Code 128. Only basic ASCII is supported.
  • Lower-case letters in Code 39. The type has capitals only, so the tool converts them.
  • Printing a small PNG larger. The edges blur and scanning gets harder. Use the SVG or a larger bar width.

Limits

Code 128 accepts up to 80 characters. GS1-128 with application identifiers and full ASCII Code 39 are not supported.

Frequently asked questions

Which barcode type should I use for my product?

For something sold in shops, EAN-13 (or UPC-A in the US and Canada). For shipping labels, stock codes and order numbers, Code 128. For cartons of retail goods, ITF-14. Ask the retailer or the logistics company what they require.

Why does the tool say my check digit is wrong?

You typed the full number, and its last digit does not match the other digits. The message shows the digit that would be correct. If you delete the last digit, the tool adds the right one.

Can I use these barcodes in a shop?

The barcodes are valid and scannable, but a shop or marketplace may require that the number belongs to your company, which is what GS1 numbers are for. A number you made up is only safe for internal use.

Should I download PNG or SVG?

PNG is a picture of fixed size, good for documents and screens. SVG is made of shapes and stays sharp at any size, so it is the better choice for printing.

Is anything uploaded?

No. The barcode is calculated and drawn in your browser, and the download is created on your device.