Home / Free tools / Text & Data / Barcode Generator
Barcode Generator
Make a barcode from a number or short text and download it as SVG or PNG. Product formats are checked, and a missing check digit is added for you. Nothing is uploaded.
Check digit helper
Runs in your browser. Nothing you paste or choose is uploaded or stored.
What this barcode generator does
This tool turns a number or a short piece of text into a barcode image that you can download as an SVG or a PNG file, print on labels, or place in a product sheet. It supports the formats sellers and small businesses use most: EAN-13 and UPC-A for retail products, EAN-8 for very small packs, ITF-14 for outer cartons, and Code 128 and Code 39 for stock codes, order numbers and shelf labels. For the product formats it checks the number first and adds the final check digit if you leave it off, so you do not print a code that no scanner will accept.
The barcode is drawn in your browser by the open-source JsBarcode library (MIT licence), which is served from this website. The values you type are not uploaded or stored on a server. The page keeps them in its address, after the # sign, so you can bookmark a barcode; that part of the address is never sent to the website.
Which barcode type should I use?
- EAN-13 has 13 digits and is the standard retail barcode outside North America and increasingly everywhere. Books use it too, with an ISBN-13 that starts with 978 or 979.
- UPC-A has 12 digits and is the traditional North American retail code. It is the same as an EAN-13 with a leading zero.
- EAN-8 has 8 digits and is for packages too small for a full code. These numbers are issued sparingly.
- ITF-14 has 14 digits and is printed on shipping cartons that hold several retail items. The first digit says how the carton is packed.
- Code 128 holds any text in the ASCII set, in a compact form. It is the usual choice for your own stock codes, order numbers and shipping labels, and it needs no registration.
- Code 39 holds capital letters, digits, space and a few symbols. It is older and wider than Code 128, but some systems still expect it.
How the check digit works
The last digit of an EAN or UPC is a check digit calculated from the others, so a scanner can notice a misread. Take the digits without the check digit and, starting from the right, multiply them alternately by 3 and 1. Add the results. The check digit is the amount needed to bring the total up to the next multiple of 10. For example, for the 12 digits 629104150021, reading from the right with weights 3, 1, 3, 1 and so on gives 1×3 + 2×1 + 0×3 + 0×1 + 5×3 + 1×1 + 4×3 + 0×1 + 1×3 + 9×1 + 2×3 + 6×1 = 57. The next multiple of 10 is 60, so the check digit is 3 and the full number is 6291041500213. Type those 12 digits above and the tool adds the 3 for you. The same method gives 036000291452 from the UPC body 03600029145.
If you type a full number whose last digit is wrong, the tool does not draw a barcode. It tells you the digit that was expected and offers a button that applies it. This catches the typical mistakes: a mistyped digit, a number cut off by a spreadsheet, or a made-up number. For a deeper check of an existing number, including restricted ranges, use the GTIN checker, and read how GTIN check digits are calculated.
Drawing a barcode is not the same as owning the number
This is the point most often misunderstood. A barcode image is only a picture of a number. Retail product numbers are allocated by GS1 to companies that join, and the company prefix identifies who owns the product. If you invent a number, or reuse one from another product, it can collide with a real product in a shop, a marketplace or Google Merchant Center. For goods you sell through retailers or list on Google, use numbers from GS1 or from a reseller that sources them from GS1, and enter the same number in your product data. For your own shelves, bins and orders, any number or text is fine, and Code 128 is the easiest.
Printing tips
- Keep the empty margin. A scanner needs a clear space on both sides of the bars. Do not crop the margin, and do not put the barcode on a patterned background.
- Use dark bars on a white background. This generator makes black on white on purpose. Colours and low contrast cause misreads.
- Prefer SVG for print. The SVG stays sharp at any size. If you use PNG, pick a large size, 3x or more, and never stretch a small image.
- Test the print. Scan the printed label with the scanner or phone app you will use. A barcode that looks fine on screen can fail after a printer smudges the thin bars.
- Keep the proportions. Resize the whole image together. Making it taller is fine; squeezing only the width can make bars too thin to read.
Worked example
You want a Code 128 label for a shelf location, "A-12-03". Choose Code 128, type A-12-03 and download the SVG. It works with any scanner that reads Code 128, and the text under the bars confirms what is encoded. Now you have a product with the 12-digit prefix 629104150021 and want an EAN-13. Choose EAN-13, type the 12 digits, and the tool adds the check digit 3 and draws 6291041500213. For scanning in a shop, print it at about 37 by 26 mm, the nominal size of an EAN-13 including its margins, and do not go below 80% of that. Sell through a marketplace? Check the product's number with the GTIN checker before you list it, and see the Merchant Center tools for feed checks.
Limits of this tool
It does not look up who owns a number, and it cannot tell whether a number is registered. It does not make GS1-128, DataMatrix, PDF417 or two-dimensional codes; for QR codes see the QR code generator. Barcodes are always black on white, and the printed size is yours to set.
Questions
How do I make a barcode for free?
Choose a type, type the number or text, and download the barcode as SVG or PNG. The tool runs in your browser and adds no watermark. For retail products, remember that the number itself must come from GS1 or a reseller; the image is only a picture of the number.
Which barcode format should I use for my products?
Use EAN-13 for retail products sold outside North America, UPC-A for the US and Canada, EAN-8 for tiny packs and ITF-14 for cartons. For your own stock codes and shipping labels, Code 128 is the easiest because it holds any text and needs no registration.
What is a check digit and why does the tool add it?
The check digit is the last digit of an EAN or UPC and is calculated from the others. Scanners use it to catch misreads. If you give the number without it, the tool calculates it and adds it. If you give a full number with the wrong last digit, the tool says so and offers the correct one.
Can I make my own EAN or UPC numbers?
You can draw a barcode from any valid-looking number, but a made-up number may belong to someone else's product. Numbers used in shops, on marketplaces or in Google Merchant Center should come from GS1 or an authorised reseller.
Should I download SVG or PNG?
Use SVG for printing, because it stays sharp at any size. Use PNG for documents and websites, at 3x or larger, and do not stretch a small image.
Why does my barcode not scan?
The usual causes are a missing blank margin, low contrast, a print that is too small or smudged, or a wrong number. Print at a larger size, keep the margin and test with the scanner you will actually use.
Is anything uploaded?
No. The value is drawn in your browser and nothing is stored or sent to a server.
Google, Merchant Center, YouTube, LinkedIn, Indeed, Glassdoor and Shopify are trademarks of their owners. Van Born Labs is independent and not affiliated with them. Google's own help pages are the final word on its rules.