Barcode Generator
Make Code 128, EAN-13, UPC-A or EAN-8 barcodes with the check digit worked out for you, then download them as PNG or print-ready SVG.
Was this tool helpful?
Thanks for the feedback!
This barcode generator makes Code 128, EAN-13, UPC-A and EAN-8 barcodes in your browser and downloads them as PNG or SVG. For EAN and UPC it works out the GS1 check digit for you, or checks the one you typed. It is for shop owners preparing product labels, small businesses tagging stock or office assets, and anyone who needs a scannable code for a reference number.
How to make a barcode
- Choose the Barcode type: Code 128 (text), EAN-13 (retail, India 890), UPC-A (US retail) or EAN-8 (small packs).
- Type the value. For Code 128 the box is labelled Text or number. EAN-13 asks for 12 digits (or 13 with check digit), UPC-A for 11 (or 12) and EAN-8 for 7 (or 8). Spaces and hyphens in EAN and UPC numbers are ignored.
- Set the Bar width (1 to 5 px per module, the narrowest bar) and Height (40 to 200 px). Untick Show number under bars if you want bars only.
- The preview updates as you type. The line under it shows the type, the check digit, the full number and the image size in pixels.
- Press Download PNG, drawn at twice the preview size, or Download SVG (for print).
If you switch type and your value does not fit the new format, the box is filled with a sample instead, such as 890123456789 for EAN-13. The samples are for trying the tool only.
The GS1 check digit, worked out
The last digit of every EAN and UPC number is a check digit that lets a scanner catch a misread. To find it, start from the rightmost data digit, multiply the digits alternately by 3 and 1, add the results, and take the amount needed to reach the next multiple of 10.
Take the EAN-13 sample 890123456789. Reading from the right, the digits 9, 7, 5, 3, 1 and 9 get weight 3, and 8, 6, 4, 2, 0 and 8 get weight 1.
- Weight 3: (9 + 7 + 5 + 3 + 1 + 9) × 3 = 34 × 3 = 102
- Weight 1: 8 + 6 + 4 + 2 + 0 + 8 = 28
- Total 130. That is already a multiple of 10, so the check digit is 0 and the full number is 8901234567890.
A second example is the textbook EAN-13 number 4006381333931. Its first twelve digits total 89, the next multiple of 10 is 90, so the check digit is 1. The same rule gives the UPC-A example 03600029145 a check digit of 2 (036000291452) and the EAN-8 example 9638507 a check digit of 4 (96385074).
If you type the full number and the last digit is wrong, the tool tells you, for example "The last digit should be 1, not 2." for 4006381333932. A wrong length gets a message such as "EAN-13 needs 12 digits (the check digit is added for you) or 13 digits including the check digit. You entered 5."
You need GS1 numbers to sell in shops
A barcode image is only a picture of a number. Drawing the picture is easy; the number is what counts. Supermarkets, retail chains and most online marketplaces expect EAN-13 or UPC-A numbers that are licensed to your company by GS1. In India that is GS1 India, whose numbers start with 890. Do not make up an 890 number, copy one from another product, or put this tool's sample on goods for sale: the number may belong to someone else, and stores can reject the product. Once GS1 has given you your numbers, this tool can turn each one into a print-ready barcode.
Code 128 needs no registration. Use it for your own stock codes, asset tags on office laptops, library or file numbers, courier and order references, and event passes. It holds up to 80 characters here: letters, digits, spaces and keyboard punctuation. A symbol such as ₹ is refused with a message asking you to remove it.
Code 128 details and printing tips
- Text is encoded in Code 128 set B. A value made only of digits, with an even count of at least 4, uses set C, which packs two digits into each symbol. So
123456is 68 modules wide, while the odd-length12345falls back to set B and is 90 modules wide. - Code 128 carries its own check value: the start value plus each symbol's value times its position, divided by 103, keeping the remainder. For 123456 that is 105 + 12×1 + 34×2 + 56×3 = 353, remainder 44. Scanners use it silently and it is not printed under the bars.
- Quiet zones, the blank margins a scanner needs, are built in: 10 modules either side of Code 128, 11 for EAN-13, 9 for UPC-A and 7 for EAN-8. Do not crop them off.
- For labels and packaging, use the SVG, which stays sharp at any size. The standard EAN-13 module is 0.33 mm, so the 95 modules of bars measure 31.35 mm at normal size. Print black on white and test-scan a printout before ordering a batch of labels.
- For a website link or a payment request rather than a product number, a QR code is the better choice.
Frequently asked questions
How do I calculate the check digit of an EAN-13 barcode?
Can I use a free barcode generator for products sold in shops?
What does 890 at the start of a barcode mean?
What is the difference between EAN-13 and UPC-A?
Which barcode type is best for inventory or asset labels?
Should I download my barcode as PNG or SVG?
Related guides
- Free QR Code Generator: URL, UPI, WhatsApp and Wi-Fi QR Codes Make free static QR codes for links, UPI payments, WhatsApp chats, Wi-Fi and maps, with print sizes, error correction and how to spot fake UPI QR stic...
- How to Make a Google Maps QR Code for Your Location Copy your Google Maps share link (or drop a pin at the exact gate), paste it into a free QR code generator, print it at the right size and test it.
- How to Make a WhatsApp Click-to-Chat Link (wa.me) With a Message Type https://wa.me/ and your number with country code but no +, 0 or spaces, e.g. wa.me/919876543210. Add ?text= for a pre-filled message. Steps, QR a...