Skip to content

Barcode Generator

Generate barcodes in EAN-13, UPC-A, Code 128, or Code 39. Live preview as you type.

13 digits

BARCODE
Enter a value to see the barcode

Choosing the right symbology

Barcode formats are not interchangeable, and picking the wrong one produces a code that a scanner rejects or reads as something else. The three supported here cover most testing needs:

FormatAcceptsLengthUsed for
EAN-13Digits onlyExactly 13, last is a check digitRetail products worldwide
Code 128Full ASCIIVariableLogistics, shipping labels, internal tracking
Code 39Digits, uppercase letters, a few symbolsVariableOlder industrial and automotive systems

Code 39 is the one that surprises people: it has no lowercase letters in its standard character set, so a value that looks fine in a form silently becomes uppercase in the code. If a system round-trips a mixed-case reference through Code 39, that is a defect worth checking for deliberately.

The EAN-13 check digit

The thirteenth digit of an EAN-13 is not data, it is a checksum computed from the first twelve. That makes it the most useful barcode test case there is, because it gives you a value that is structurally valid and a value that is structurally invalid differing by one character.

A scanner will refuse a code whose check digit does not match, so a system that accepts a hand-typed product number without verifying the checksum is accepting data a scanner would have rejected. Test both: a correct code, and the same code with the final digit changed.

Why a barcode will not scan

Downloading as SVG avoids the last of these entirely, because a vector stays sharp at any print size. For anything that will be printed, prefer the vector output.

Testing a feature that prints barcodes

  1. Print at the real size on the real medium. A label that scans on a monitor can fail on thermal paper.
  2. Test the longest value the format allows, since a longer Code 128 value produces a wider code that may not fit the label.
  3. Test a value with characters at the edge of the symbology: lowercase for Code 39, a space or symbol for Code 128.
  4. Check the quiet zone survives the template, especially near a page edge or a fold.
  5. Scan with the hardware that will be used in production, not only with a phone app.
  6. For EAN-13, test a deliberately wrong check digit and confirm the system rejects it.

Generation happens in your browser, so internal product codes and unreleased identifiers are not sent anywhere.

Frequently asked questions

What is the difference between EAN-13 and UPC-A?

UPC-A is the twelve-digit format used mainly in North America, and EAN-13 is the thirteen-digit international superset: a UPC-A value is an EAN-13 with a leading zero. Systems handling both need to normalise, and a mismatch there is a common integration defect.

Why does my Code 39 barcode lose lowercase letters?

Because the standard Code 39 character set contains only uppercase letters, digits and a small set of symbols. Lowercase input is converted, which silently changes a mixed-case reference. Use Code 128 when case must be preserved.

What is the check digit in an EAN-13 barcode?

The final digit, computed from the preceding twelve. A scanner rejects a code whose check digit does not match, so it makes an excellent pair of test cases: one valid code and the same code with the last digit altered.

Should I use PNG or SVG for a barcode?

SVG for anything printed, because a vector stays sharp at any size and blurred bar edges are a leading cause of scan failures. PNG is fine for on-screen use and for pasting into a document that cannot handle vectors.

Why does my barcode scan on screen but not on paper?

Print size and print quality. Bars that are crisp on a monitor can smear on thermal paper or fall below a scanner's resolution when scaled down, and a template may crop the quiet zone. Always test the printed article rather than the screen version.

Can a barcode hold letters as well as numbers?

It depends on the symbology. EAN-13 is digits only. Code 39 accepts uppercase letters, digits and a few symbols. Code 128 accepts the full ASCII set, which makes it the usual choice for internal references that mix letters and numbers.