Barcode Generator
10 types · PNG · SVG
Barcode type

Look and size

The bar width is the narrowest bar. For print at 300 dpi, 4 px is about 0.34 mm, close to the standard EAN and UPC size. SVG stays sharp at any size.

How to make a barcode

  1. Choose the barcode type. Use EAN-13 or UPC-A for products sold in shops, EAN-13 / ISBN for books, Code 128 for your own labels (stock, assets, tickets), GS1-128 and ITF-14 for shipping boxes and pallets. Not sure? The table below helps.
  2. Type the number or text. The barcode updates while you type. For EAN, UPC and ITF-14 you can leave out the last digit: the check digit is calculated for you. If you type it, the tool checks it.
  3. Set the size if you need to: bar width, height, text size, colors and the quiet zone (the white space left and right that scanners need).
  4. Download PNG for documents, label programs and web pages, or SVG for print and design tools. Copy image puts the PNG on your clipboard.
  5. Need many? Switch to Many and paste one value per line. Print the sheet or save it as a PDF.

You can open the tool with a barcode already filled in: geektools.net/barcode_generator?type=ean13&data=400638133393. Copy link makes such a link for the current barcode.

Which barcode type should I use?

TypeWhat it holdsUsed for
Code 128Any ASCII text: letters, digits, symbols. Any length.Inventory, asset tags, shipping labels, tickets, library and lab samples. The best choice for your own codes.
EAN-1313 digits (12 + check digit)Products in shops worldwide. Books (ISBN, starts with 978 or 979) and magazines (ISSN, starts with 977).
UPC-A12 digits (11 + check digit)Products in shops in the USA and Canada.
EAN-88 digits (7 + check digit)Very small products where EAN-13 does not fit.
UPC-EA UPC-A number with zeros removed, 8 digitsSmall packages in the USA and Canada (cans, sweets).
GS1-128Data fields with application identifiers, for example (01) product, (17) expiry date, (10) batchPallets, cases, food and medicine logistics.
ITF-1414 digits (GTIN-14)Outer cartons. Prints well on brown cardboard; the frame (bearer bars) protects it.
Code 39A–Z, 0–9 and - . $ / + % and spaceOlder industrial, military and car industry labels, name badges.
Interleaved 2 of 5An even number of digitsWarehouses and distribution, older systems.
CodabarDigits and - $ : / . +, with start/stop letters A–DLibraries, blood banks, photo labs, older courier forms.

Code 128 picks its code sets (A, B and C) by itself. Long runs of digits are packed two per symbol in set C, so 1234567890 makes a much shorter barcode than the same digits in Code 39.

EAN and UPC numbers: where they come from

A barcode is only a picture of a number. For products in shops the number matters: it must be unique worldwide. Companies get a GS1 company prefix from their national GS1 organisation and build their product numbers (GTINs) from it. Books get an ISBN from the national ISBN agency.

  • The first digits of an EAN-13 are the GS1 prefix. It shows which GS1 organisation gave out the number, not the country where the product was made.
  • 978 and 979 are books (ISBN), 977 is magazines (ISSN).
  • 200–299 are for use inside one company or shop, for example weighed fruit or meat, or your own shelf labels. They are never unique outside that shop.
  • A UPC-A number is an EAN-13 with a leading 0: 036000291452 is the same product as 0036000291452.

Buying cheap numbers from resellers is risky: big retailers and marketplaces check the number against the GS1 database and can reject products whose number belongs to another company.

How the check digit works

EAN, UPC, ITF-14, SSCC and every other GTIN use the same rule (modulo 10). Start at the rightmost digit, multiply the digits by 3, 1, 3, 1 … , add everything, and take the amount needed to reach the next multiple of 10.

Digit400638133393
Times131313131313
Result40018324193999

The sum is 89. The next multiple of 10 is 90, so the check digit is 1 and the EAN-13 is 4006381333931. One wrong digit, or two neighbouring digits swapped, always changes the result, so a scanner notices most typing and printing errors.

Code 128 has its own check symbol (a weighted sum modulo 103) that is always added and never printed in the text. Code 39 can have an optional modulo 43 check character, and an ISBN-10 uses modulo 11 (that is why it can end in X).

GS1-128: application identifiers

Type each field as an application identifier (AI) in brackets followed by its value, for example (01)09501101530003(17)271231(10)LOT42. The tool adds the FNC1 characters that a GS1-128 barcode needs, checks fixed lengths, dates and GTIN check digits, and prints the text with brackets.

AIMeaningFormat
(00)SSCC, the serial number of one pallet or parcel18 digits
(01)GTIN, the product number14 digits
(02)GTIN of the products inside a logistic unit14 digits
(10)Batch or lot numberup to 20 characters
(11)Production dateYYMMDD
(15)Best before dateYYMMDD
(17)Expiry dateYYMMDD
(21)Serial numberup to 20 characters
(37)Number of items insideup to 8 digits
(3103)Net weight in kg with 3 decimals (001250 = 1.250 kg)6 digits
(400)Customer's order numberup to 30 characters

Put fixed-length fields (like 01, 17 or 3103) first and variable-length fields (like 10 or 21) last: that saves FNC1 characters and makes the barcode shorter. A GS1-128 barcode holds at most 48 data characters.

Print size and scanning tips

  • EAN-13 and UPC-A at 100% have a narrowest bar of 0.33 mm, bars about 22.85 mm high, and are about 37.3 mm wide including the quiet zones. You may scale them from 80% to 200%. Do not cut the height to save space: short bars are harder to scan.
  • Keep the quiet zone. Scanners need plain space left and right: 10 bar widths for Code 128, Code 39 and ITF, and 7 to 11 for EAN and UPC. Do not put text or lines there.
  • Dark bars on a light background. Black on white is best. Red laser scanners see red, orange and yellow as white, so bars in those colors cannot be read. The tool warns you about weak colors.
  • Print at the final size. Scaling a small PNG up makes blurry edges, and scaling by odd amounts makes uneven bars. Use the SVG, or set the bar width so the PNG is already the size you print.
  • Thermal label printers (203 dpi) print one dot as 0.125 mm. A bar width of 2 or 3 px (0.25–0.375 mm) works well on them.
  • Test first. Scan a test print with the scanner that will be used, or a phone app, before printing hundreds.

Make barcodes in code

WhereCode
Pythonfrom barcode import Code128; from barcode.writer import ImageWriter; Code128("ABC-12345", writer=ImageWriter()).save("label")
JavaScript (browser)JsBarcode("#svg", "400638133393", { format: "EAN13" })
Node.jsconst png = await require("bwip-js").toBuffer({ bcid: "code128", text: "ABC-12345", scale: 3, height: 10, includetext: true })
Java (ZXing)BitMatrix m = new Code128Writer().encode("ABC-12345", BarcodeFormat.CODE_128, 400, 120); MatrixToImageWriter.writeToPath(m, "PNG", Path.of("label.png"));
Linuxzint -b 20 -d "ABC-12345" -o label.svg

This page uses its own small encoder. It follows the published symbol specifications and was tested by reading thousands of its barcodes back with the open-source ZXing decoder.

Frequently asked questions

Can I use these barcodes on products I sell in shops?

The barcode images are free for any use. But for retail you need a real product number: EAN and UPC numbers must come from GS1 (or from your national ISBN agency for books). Shops and marketplaces such as Amazon check the number against the GS1 database, so a made-up number can be rejected or clash with another company's product. This tool draws the barcode for the number you already have.

What is the difference between UPC and EAN?

UPC-A has 12 digits and is used mainly in the USA and Canada. EAN-13 has 13 digits and is used in the rest of the world. A UPC-A number is an EAN-13 number with a leading 0, and shop scanners everywhere read both. UPC-E and EAN-8 are short versions for very small packages.

Which barcode should I use for inventory or asset labels?

Code 128. It holds letters, digits and symbols, it is compact, and every scanner reads it. Long runs of digits are packed two per bar pattern, so a 10-digit number makes a short barcode. Code 39 is older and wider but still common in some industries, and it can be read by very simple scanners.

How is the check digit calculated?

For EAN, UPC, ITF-14 and GTIN numbers, start at the rightmost digit and multiply the digits by 3 and 1 in turn. Add the results and take the amount needed to reach the next multiple of 10. For 400638133393 the sum is 89, so the check digit is 1 and the full EAN-13 is 4006381333931. This tool adds it when you leave it out and tells you when a typed check digit is wrong.

How do I make an ISBN barcode for a book?

Choose EAN-13 / ISBN and type the ISBN-13 (starting with 978 or 979) or an old ISBN-10. Hyphens are fine. An ISBN-10 is converted to ISBN-13 with a new check digit, and the ISBN is printed above the bars as on book covers. A price add-on (the small 5-digit barcode) is not included.

Why does my barcode not scan?

The usual reasons are: no white space (quiet zone) left and right of the bars, bars printed too thin for the printer, a blurry or stretched image, too little contrast, or bars in red, orange or yellow, which red laser scanners cannot see. Use black on white, keep the quiet zone, print the SVG or a PNG made at the final size, and test with a real scanner or a phone app before printing many.

Can I make many barcodes at once?

Yes. Switch to Many and paste one value per line, for example a column copied from Excel. Up to 500 barcodes are drawn at once with the same settings. Lines with a problem are marked. Print them as a label sheet or save them as a PDF from the print window, or download each barcode as PNG.

More tools