Design tool

Barcode Generator

Choose a barcode format, enter text or product digits, and download a black-and-white barcode.

Runs in your browser. No upload.

Code 128 accepts up to 80 printable ASCII characters.

Generated locally. Retail barcodes need a valid product identifier.

About this tool

Barcode Generator made simple.

Code 128 supports up to 80 printable ASCII characters. EAN-13 and UPC-A accept data without a check digit and calculate it for you, or validate a supplied check digit. Retail barcodes do not assign a product identifier; obtain a valid GTIN from the relevant issuing organization before using one commercially.

Guide

Using Barcode Generator

This page draws a barcode from text or numbers and lets you save it as an SVG or a PNG image. It offers three types: Code 128 for ordinary text, and EAN-13 and UPC-A for product numbers. For the two product types you can leave off the last digit, called the check digit, and the page works it out, or you can type the full number and the page checks that last digit. The drawing is made on your device in black on white. The page does not create or register product numbers, so a number you invent is not a real product code.

How to use it

  1. Open the Type list and choose Code 128, EAN-13 or UPC-A. The hint under the list tells you what that type accepts.
  2. Type your value in the Value box. For Code 128 use plain keyboard characters. For EAN-13 use 12 or 13 digits, and for UPC-A use 11 or 12 digits.
  3. Leave Show text below ticked if you want the value printed under the bars, or untick it for bars only.
  4. Press Generate. The barcode appears, or a short message tells you what to fix. A wrong check digit is reported instead of being corrected.
  5. Press Download SVG or Download PNG. A link with the file size appears, and you click that link to save the file.
  6. Press Clear to reset the type, the value and the tick box.

Worked examples

EAN-13 with the check digit left off

You enter
Type
EAN-13
Value
400638133393
You get
Barcode number
4006381333931
Check digit
1

Starting from the right, the twelve digits are multiplied by 3, 1, 3, 1 and so on. Those products add up to 89. The next multiple of ten is 90, so the check digit is 1.

Run through the tool’s own code.

EAN-13 with a wrong check digit

You enter
Type
EAN-13
Value
4006381333932
You get
Status
The supplied barcode check digit is not valid.

The right last digit for this number is 1, not 2. The page does not fix it for you. Check for a typing slip, or remove the last digit and let the page add the correct one.

Run through the tool’s own code.

UPC-A from 11 digits

You enter
Type
UPC-A
Value
03600029145
You get
Barcode number
036000291452
Check digit
2

The same rule is used with eleven digits, and the page adds a twelfth. The printed text under the bars is split into groups of digits, with the check digit at the right.

Run through the tool’s own code.

Code 128 with letters, numbers and symbols

You enter
Type
Code 128
Value
Order #A-1042
You get
Barcode
drawn
Text below
Order #A-1042

Every character is on a standard English keyboard, so it is accepted. Spaces at the start or end of the box are trimmed before the barcode is drawn.

Run through the tool’s own code.

Code 128 with an accented letter

You enter
Type
Code 128
Value
Café
You get
Status
Code 128 accepts 1–80 printable ASCII characters.

The letter é is not in the plain ASCII set that this page allows, so the barcode is not made. Replace it with e, or use a text without accents.

Run through the tool’s own code.

EAN-13 typed with spaces

You enter
Type
EAN-13
Value
4006 3813 3393
You get
Barcode number
4006381333931

Spaces are removed before counting digits, so copied numbers that are grouped for easy reading still work. Any other non-digit character, such as a letter or a dash, is rejected.

Run through the tool’s own code.

When it helps

  • Print Code 128 labels for boxes, shelves or tools in a workshop, a club room or a home storage area.
  • Make a barcode for an order number or a ticket number that a handheld scanner will read into a system.
  • Draw the image for a product number you have already received from the proper issuing body, for use on your own artwork.
  • Check whether the last digit of an EAN-13 or UPC-A number you were given is correct.
  • Teach or learn how a check digit works by trying a few numbers and seeing which last digit the page adds.
  • Create a simple sample barcode for a school project or a layout mock-up that is clearly marked as a sample.

Limits to keep in mind

  • Only three types are offered: Code 128, EAN-13 and UPC-A. Other barcode types and two-dimensional codes are not available here.
  • Code 128 takes 1 to 80 printable ASCII characters, which means letters, digits, spaces and common symbols from a standard keyboard, but no accents, emoji or non-Latin letters.
  • EAN-13 needs exactly 12 or 13 digits, and UPC-A needs exactly 11 or 12. Letters and other symbols are refused.
  • The page does not look up who owns a number or whether it belongs to a real product. A valid check digit only means the arithmetic fits.
  • The look is fixed: black bars on white, with set bar width and height. The PNG is small, about 238 by 136 pixels for EAN-13, so the SVG is the better file for printing or resizing.
  • The page cannot tell whether a given scanner, shop or marketplace will accept the image. Size and print quality rules for retail codes are set elsewhere, so test and ask.

Tips

  • Use the SVG when you need to enlarge or print the barcode. It stays sharp at any size, while the PNG is made at the small size shown on screen.
  • Test the printed barcode with the same kind of scanner that will be used, before you print a large batch.
  • Keep a clear white space on both sides of the bars when you place the image in a layout, and do not stretch it out of shape.
  • For your own inventory, choose Code 128. It needs no registered number, so you can use any short code that makes sense to you.
  • If the page says the check digit is wrong, first look for a swapped or missing digit in the number you typed.
  • Write down the exact value you used, so you can make the same barcode again later.

Sources

Common questions

About Barcode Generator.

Which barcode type should I choose?

Choose Code 128 for your own labels, because it carries letters and symbols as well as digits. Choose EAN-13 or UPC-A only when you have a product number of the right length that was issued to you. Those two types carry digits only.

What is a check digit and how is it worked out?

It is the last digit of the number, added so that a scanner can spot a typing slip. Digits are weighted 3 and 1 alternately, starting with 3 at the right end of the number without the check digit. The sum is taken to the next multiple of ten. The GS1 General Specifications describe this method.

Can I sell a product in shops with a barcode made here?

The image alone does not give you a product number. The page says you need a valid number from the proper issuing organization, and in the GS1 system such numbers come from a member organization. Each shop or marketplace has its own rules, so ask them before you print.

Can I make up a number for testing?

You can draw a code from any digits that pass the check, but an invented number can match a real product somewhere. For internal tests and labels it is safer to use Code 128 with your own text, and keep EAN and UPC for numbers that were issued to you.

Why does the page say my check digit is not valid?

The last digit you typed does not match the digit the arithmetic gives for the other digits. You may have swapped two digits or mistyped one. Remove the last digit and press Generate, and the page will add the correct one.

Why can Code 128 take only 80 characters of plain ASCII?

That is the rule this page uses: printable characters from the space to the tilde, up to 80 of them. Accented letters, emoji and other scripts are refused, and the message tells you the allowed range. Shorten the text or remove special letters.

Should I download the SVG or the PNG?

Choose the SVG for printing and for anything that will be enlarged, since it is made of shapes and stays sharp. The PNG is saved at the size you see on screen, about 238 by 136 pixels for an EAN-13, so it goes soft when stretched.

What does Show text below do?

It prints the value as readable text under the bars. You can tick or untick it after the barcode is drawn and the picture updates. For EAN-13 and UPC-A the digits are split into the usual groups, with the check digit at the end.

Can I make EAN-8, ITF-14, GS1-128 or Data Matrix codes?

No. This page makes Code 128, EAN-13 and UPC-A only. GS1-128 is described as a subset of Code 128 in the GS1 documents, but this page does not build its special data structure. For a square code, use the QR Code Generator.

Is my value sent to a server?

No. The barcode is drawn in your browser with a drawing script that comes from the site's own files, and the status line says no data was uploaded. Your value is used only to draw the bars on your screen.

Will a phone camera scan the barcode from my screen?

It might, but this depends on the app, the screen brightness and the size of the bars. Many scanner apps read several barcode types, and some read only certain ones. Try the app or scanner you will really use before you rely on it.

Which barcode types can I generate?

This tool supports Code 128 for printable text, EAN-13 for retail numbers and UPC-A. EAN-13 and UPC-A check digits are calculated or validated automatically.

Can I use a generated UPC or EAN code to sell a product?

A barcode image does not assign a valid product identifier. Obtain a legitimate GTIN from the appropriate issuing organization before using a retail code commercially.