Which barcode type should I use?
Usually whoever scans the barcode, a store, a warehouse or your own app, decides the type. For a link, Wi-Fi login or contact card, use the QR code generator instead. These are the six this barcode generator draws:
- EAN-13 carries a 13-digit GTIN, the product number GS1 lists for trade items scanned at retail checkouts. GS1 has also allocated the prefixes 978 and 979 to the International ISBN Agency for books.
- UPC-A carries a 12-digit GTIN. GS1 notes that it may be decoded as a 13-digit number with an implied leading zero.
- EAN-8 holds an 8-digit GTIN-8. With quiet zones it is 81 modules wide against 113 for EAN-13, so it fits where space is tight. GS1 member organizations issue GTIN-8 numbers from GS1-8 prefixes of their own.
- ITF-14 holds a 14-digit GTIN-14. GS1 lists it in the symbol specification table for trade items scanned in general distribution, with wider bars than retail barcodes.
- Code 128 holds any ASCII text: capital and lowercase letters, digits, symbols and even control characters. Its code set C packs two digits into one character, so long numbers stay short. GS1-128 is a subset of Code 128 that starts with a special FNC1 character; this tool draws plain Code 128.
- Code 39 holds capital letters A to Z, digits, space and the symbols - . $ / + %, as listed in ISO/IEC 16388. It is wider than Code 128 for the same text, but some older systems still ask for it.
How the check digit works
GS1 numbers end with a check digit so that a scanner, or a person typing the number, can catch a mistake. The GS1 General Specifications use the same method for GTIN-8, GTIN-12, GTIN-13 and GTIN-14:
- Starting with the digit next to the check digit and moving left, multiply the digits by 3, 1, 3, 1 and so on.
- Add up the results.
- The check digit is what you need to add to reach the next multiple of ten. If the sum already is one, the check digit is 0.
This generator calculates the check digit when you leave it out, and checks it when you type the full number. A wrong check digit means at least one digit is off, so the tool tells you which check digit it expected instead of drawing a barcode for a number that does not add up. Code 128 has its own check character, a weighted sum of all symbol values modulo 103, which the generator always adds and which is not printed in the text. For Code 39 a check character is optional, so turn it on only if your scanner or system expects one.
Quiet zones, bar width and height
A barcode needs a clear space before its first bar and after its last, the quiet zone. Sizes are given in modules, the width of the narrowest bar, also called the X-dimension. The generator keeps these GS1 minimums:
| Type | Quiet zone left | Quiet zone right | GS1 target size |
|---|---|---|---|
| EAN-13 | 11 modules | 7 modules | 0.330 mm bars, 22.85 mm high |
| UPC-A | 9 modules | 9 modules | 0.330 mm bars, 22.85 mm high |
| EAN-8 | 7 modules | 7 modules | 0.330 mm bars, 18.23 mm high |
| ITF-14 | 10 modules | 10 modules | 0.495 mm bars, at least 31.75 mm high |
| Code 128, Code 39 | 10 modules | 10 modules | Set by your application |
For retail point of sale, the GS1 symbol specification table allows EAN-13 and UPC-A bars from 0.264 mm to 0.660 mm wide, with the height growing in proportion. The 10-module quiet zone for Code 128 and Code 39 follows the GS1 rule for GS1-128; check your own system's rules for these two. The guard bars of EAN and UPC barcodes run 5 modules further down than the others, and so do the bars of the first and last character of a UPC-A, as the specification requires.
ITF-14 has two extras. GS1 calls bearer bars, the thick lines above and below, mandatory unless they are not technically feasible: at least twice the narrow bar on top and bottom for printing methods without plates, and a 4.83 mm frame around the whole barcode for printing plates. The wide bars are 2.25 to 3 times the narrow ones, with 2.5 as the target.
Do you need a GS1 number for retail?
This tool only draws the barcode. For products sold in stores or online marketplaces, the number in the barcode has to be a GTIN that belongs to you (the guide QR code vs barcode explains when a QR code is the better choice and what changes with Sunrise 2027). According to the GS1 General Specifications, GS1 member organizations license GS1 Company Prefixes to companies, and the company then creates its GTINs from that prefix. GS1 US explains that membership does not come with ready-made barcodes: you assign GTINs to your products and create the barcodes yourself, which is exactly the step this generator does.
The same GS1 US page warns that retailers check UPCs in the GS1 database, and if a number belongs to another company or is not found, the product may be rejected or need new labels. For numbers that never leave your company, GS1 reserves Restricted Circulation Numbers, for example 13-digit numbers starting with 04. They must not be used in open trade, and GS1 allows them only in EAN-13, EAN-8, UPC-A and UPC-E barcodes. The EAN-13, EAN-8 and ITF-14 examples on this page use 952, the prefix GS1 sets aside for demonstrations and examples, and the UPC-A example uses the 04 range, so none of them clash with a real product.
Printing barcodes that scan
- Prefer SVG for print. The file is in millimeters, so a 0.33 mm bar is printed at 0.33 mm.
- Match the PNG to the printer. A bar cannot be 3.9 pixels wide, so the generator rounds each module to whole pixels at the resolution you pick and tells you the bar width you really get. At 300 DPI, 0.33 mm becomes 4 pixels, or 0.339 mm. The resolution is stored in the PNG, so layout programs place it at that size.
- Keep dark bars on a light background. GS1's verification guidance says black ink on white paper will almost certainly reach the top grade for symbol contrast, and that the darkest bar must reflect at most half as much light as the lightest part. The generator warns you about color pairs that look too weak on screen.
- Test a print with the scanner or app that will read it before you print a whole run.
How to use the barcode generator
- 1Pick the type: EAN-13, UPC-A, EAN-8 or ITF-14 for GS1 numbers, Code 128 or Code 39 for your own text.
- 2Type the number or text. For GS1 numbers you can leave out the check digit; it is added and shown below the barcode.
- 3Set the bar width and height in millimeters, or press Use GS1 size, and choose the colors and whether the text shows.
- 4Download the SVG or a PNG at your printer's resolution, or copy the SVG code. For many barcodes, switch to Batch and download a ZIP.
Guides on this topic
- QR Code vs Barcode: Which One for Products, Menus, Tickets
- UPC vs EAN: How to Get a Barcode for a Product
Frequently asked questions
Is this barcode generator free?
Yes. It is free, with no signup and no watermark, and you can use the barcodes in commercial work. Everything is drawn in your browser, so the numbers and text you enter are not sent to a server.
Why does it say my check digit is wrong?
EAN-13, EAN-8, UPC-A and ITF-14 numbers end with a check digit that is calculated from the other digits. If you type all the digits and the last one does not match, at least one digit is wrong, so the generator stops instead of drawing a barcode for a number that does not add up. Check the number against its source, or type it without the last digit and the correct check digit is added.
Can I use these barcodes to sell products in stores?
The barcode itself, yes, but the number inside it has to be yours. Product numbers for retail (GTINs) come from GS1: a GS1 member organization licenses your company a GS1 Company Prefix to build them from, or single numbers. GS1 US explains that retailers check UPCs in the GS1 database, and a number that belongs to another company or is not found can lead to rejection or relabeling. Get your numbers from GS1, then draw the barcodes here.
What is the difference between Code 128 and Code 39?
Code 128 can hold all ASCII characters, including lowercase letters and symbols, and packs digits two per character, so it stays compact. Code 39 holds only capital letters, digits, space and the symbols - . $ / + %. Each Code 39 character takes 16 module widths here (three wide elements at 3 times the narrow width, plus a gap), against 11 for Code 128, so the same text gives a much wider Code 39 barcode. Use Code 39 when a system or scanner asks for it.
Should I download SVG or PNG?
SVG for print and design programs: it is a vector file in millimeters, so the bars stay sharp at any size and the printed size is exact. PNG for places that only take images, like a label app or a document. Choose the print resolution of your printer; the generator snaps each bar to whole pixels at that resolution and writes it into the file, so programs that read it place the PNG at the right size.
Why is there empty space to the left and right of the bars?
That is the quiet zone, the clear space GS1 requires before the first bar and after the last one. GS1 specifies 11 modules on the left and 7 on the right for EAN-13, 9 on each side for UPC-A, 7 for EAN-8 and 10 for ITF-14 and GS1-128. Keep it free of text and graphics when you place the barcode in a layout.
Can I make many barcodes at once?
Yes. Switch to Batch, put one value per line (up to 500) and download all of them as SVG or PNG files in one ZIP. Lines with a problem, like a wrong check digit, are listed with the reason so you can fix them.