What is a barcode generator?
A barcode generator turns a number or a short text into the pattern of bars that a scanner reads. This one creates the six most used linear formats: EAN-13 and EAN-8 (retail products worldwide), UPC-A (retail in the United States and Canada), Code 128 (shipping, logistics and any ASCII text), Code 39 (industrial and inventory labels, letters and digits) and ITF (Interleaved 2 of 5, used on cartons and pallets). You type the value, pick the format and get an image you can download as SVG (sharp at any size, ideal for print) or PNG (at several sizes), or copy straight into a document.
The retail formats end with a check digit, a last digit calculated from the others so a scanner can catch a misread. In EAN-13, EAN-8 and UPC-A the tool calculates it for you: type the number without the check digit (12 digits for EAN-13, 7 for EAN-8, 11 for UPC-A) and it adds it; or type the full number and it validates the digit and tells you the correct one if it is wrong. The rule, used by GS1, is to multiply the digits by alternating weights of 3 and 1 starting from the rightmost digit of the body, add them and take what is needed to reach the next multiple of 10.
You can adjust the bar width, height, margin, bar color and background and whether to print the value below the bars. The tool warns when the contrast is too low or the bars are lighter than the background, because most scanners need dark bars on a light background. It all happens in your browser; the value you type is not sent anywhere.
How to create a barcode
- Choose the barcode type: EAN-13, EAN-8, UPC-A, Code 128, Code 39 or ITF.
- Type the value. The hint under the field says what the format accepts: digits only for EAN, UPC and ITF; letters A-Z, digits and
- . $ / + %and space for Code 39; any ASCII character for Code 128. - For EAN and UPC, type the digits without the check digit to have it calculated, or the full number to have it validated. If it is wrong, the tool offers the correct value in one click.
- Open the options to change bar width, height, margin, colors and whether the value text shows.
- Download the SVG or the PNG (choose its size), copy the image or copy the value.
- Print at a size that keeps the bars sharp, and test the result with a scanner or a phone camera app before printing in volume.
Examples
EAN-13 with a calculated check digit
Typing the 12 digits 400638133393 gives the check digit 1, so the full code is 4006381333931.
Validating a full code
5901234123457 is valid: its check digit 7 matches the first 12 digits. Changing the last digit to 8 shows an error and suggests 7.
UPC-A and EAN-8
03600029145 (11 digits) gives the check digit 2 and the full UPC-A 036000291452. 7351353 (7 digits) gives the check digit 7 and the EAN-8 73513537.
Code 128 for any text
Code 128 encodes any ASCII text, for example stdlib.tools-2026, so it suits shipping labels, serial numbers and internal references.
Code 39 and ITF
STDLIB-2026 works in Code 39 (lower case is converted to upper case). ITF needs an even number of digits because they are encoded in pairs: 12345670 works, and for an odd count you can add a leading 0.
Common mistakes
- Using a made-up product number for a real product. To sell products in shops you need numbers licensed through GS1; the tool draws a barcode for any valid number but does not register it to a company.
- Wrong length. EAN-13 needs 12 or 13 digits, EAN-8 needs 7 or 8, UPC-A needs 11 or 12. The message tells you how many you typed.
- A wrong check digit. The tool shows the one it expects, with a button to use it.
- Light bars on a dark background. Most scanners will not read it. Use dark bars on a light background.
- Low contrast. Pale grey on white fails in many scanners; keep a strong contrast.
- Printing too small or too blurry. Use the SVG for print, keep the quiet margin around the code and test the result.
- Unsupported characters. Code 39 and the digit-only formats reject other characters and list them.
Frequently asked questions
What is the difference between EAN-13 and UPC-A?
UPC-A has 12 digits and is used in North America; EAN-13 has 13 and is used worldwide. A UPC-A code is an EAN-13 with a leading 0.
What is a check digit?
The last digit of the code, calculated from the others so that errors can be detected by the scanner.
Which barcode should I use for text?
Code 128 accepts any ASCII character. Code 39 is simpler and accepts uppercase letters, digits and a few symbols.
SVG or PNG?
SVG for print and design work since it scales without losing sharpness; PNG for documents and web pages.
Can I make a QR code too?
Yes, with the QR code generator. For identifiers use the UUID generator.