HandyBench

Barcode Generator

Create CODE128, EAN, UPC and CODE39 barcodes.

How to use the Barcode Generator

  1. 1 Type or paste the value to encode.
  2. 2 Pick a barcode format (CODE128, EAN-13, EAN-8, UPC, CODE39 or ITF-14).
  3. 3 Adjust bar width, height and whether to show the value, then download as PNG or SVG.

How the six formats differ

Every format here is a one-dimensional barcode: a row of bars and gaps whose widths encode characters. The formats differ in what they can hold and in how a scanner knows it read them correctly.

FormatAcceptsCheck digitTypical use
CODE128Any ASCII textBuilt in, handled by the encoderShipping labels, inventory, asset tags
EAN-1312 or 13 digitsLast digitRetail products worldwide
EAN-87 or 8 digitsLast digitVery small packages
UPC-A11 or 12 digitsLast digitRetail products in North America
CODE39Digits, capital letters, and a few symbols such as - . $ / + %None requiredOlder industrial and ID-badge systems
ITF-1413 or 14 digitsLast digitOuter cartons and cases

Check digits, with a real calculation

For EAN-13, the digits are weighted 1, 3, 1, 3 and so on from the left, summed, and the check digit is whatever brings the total up to the next multiple of 10. For the twelve digits 590123412345 the weighted sum is 83, so the check digit is 7 and the full code is 5901234123457. If you type only 12 digits the encoder appends that 7 for you. If you type 13 digits and the last one is wrong, such as 5901234123458, the tool shows its error message and disables both download buttons.

UPC-A works the same way with the weights reversed: digits in odd positions are multiplied by 3. For the eleven digits 03600029145 the check digit comes out as 2, giving 036000291452.

Common mistakes

  • Treating a valid pattern as a real product code. A correct check digit only proves the number is well formed. Numbers for goods sold through shops are licensed by GS1, so a made-up EAN will scan but may collide with someone else's product.
  • Using EAN-13 for internal labels. Pick CODE128 for your own SKUs; it takes letters and any length.
  • Bars that are too thin. The width control runs from 1 to 6 pixels per module. A 1 pixel bar looks fine on screen but prints poorly on a low-resolution thermal printer, so raise it for print.
  • Lowercase in CODE39. The format only defines capital letters; the encoder uppercases what you type.
  • Clipping the quiet zone. Keep blank space on both sides of the printed bars. The tool adds a 10 pixel margin, and cropping it can stop scans.

Need to encode a link or longer text instead? A two-dimensional symbol is a better fit, so try the QR code generator.

Examples

  • ▸ Encoding a 12-digit UPC for a retail product label.
  • ▸ Making a CODE128 barcode for an inventory or asset tag.

Frequently asked questions

Which barcode format should I use?

Use EAN-13 or UPC for retail products sold in stores (these require a registered code from GS1 to be truly unique). Use CODE128 for general-purpose internal tracking — it encodes any letters and numbers and is the most flexible format.

Why does EAN-13 or UPC reject my value?

These formats need an exact digit count: 12 or 13 digits for EAN-13, 11 or 12 for UPC-A, 7 or 8 for EAN-8. If you enter one digit fewer than the full length, the check digit is added for you. If you enter the full length with a wrong last digit, the tool shows an error and disables the download buttons.

Can I use a generated barcode for real retail products?

Only if the number itself is a real, registered code from GS1 (or your regional numbering authority) — this tool renders any value you give it correctly, but does not assign or verify globally unique product codes.

Will these barcodes scan with a phone camera or scanner?

Yes. They are drawn as standard linear barcodes that a scanner app or dedicated scanner can read, as long as the format and value are valid. Keep the blank margin around the bars and avoid very thin bars when printing.

What is a check digit?

It is the final digit of EAN, UPC and ITF-14 codes, calculated from the other digits using alternating weights of 1 and 3. Scanners recompute it to catch misreads, so a code with a wrong check digit is rejected.

Should I use CODE128 or CODE39?

CODE128 is denser and encodes the full ASCII range, so it fits more data in less width. CODE39 is older and limited to capital letters, digits and a few symbols, so choose it only when a legacy system requires it.