Barcode Generator
Create scannable barcodes for stock labels, asset tags and product packaging, with check digits worked out for you and print-ready SVG or PNG files.
Runs entirely in your browser. Nothing you add is sent to us.
Create a free account to use the Barcode Generator
Free forever for this tool. Takes a few seconds — then you come straight back here.
- All 150 free tools, one login
- Free website audit with fixes
- Search Console dashboard
- Free keyword rank tracker
Already have an account? Sign in
How to use the Barcode Generator · 45 sec
A barcode generator turns a product number, stock code or reference into bars that a scanner can read. Our free tool makes Code 128, EAN-13, UPC-A and Code 39 barcodes in your browser, with the check digit calculated or validated for you. You can set the bar width, height, quiet zone and colours, show or hide the human-readable text, and download a crisp SVG for print or a high-resolution PNG. There are no sign-ups, watermarks or limits, and nothing you type is sent to a server.
How to use the Barcodes
- 1 Pick the barcode typeChoose Code 128 for your own stock, asset or shipping labels, EAN-13 for retail products in the UK and Europe, UPC-A for North America, or Code 39 if a system specifically asks for it.
- 2 Enter the number or textFor EAN-13 type 12 digits and for UPC-A type 11. The check digit is added for you, or checked if you type the full number.
- 3 Adjust the sizeSet the bar width, bar height, quiet zone and text size. Wider bars are easier to scan and print more reliably.
- 4 Check the warningsLook out for notes about low contrast, red bars, a small quiet zone or very thin bars, which all cause scanning problems.
- 5 Download and testDownload the SVG for print or a PNG at up to 8 times the size, then print a sample and test it with the scanner that will read it.
Which barcode type should you use?
The right symbology depends on who will scan the barcode. If it only needs to work inside your own business, you have a free choice. If it goes on a product sold through shops or online marketplaces, the retailer decides, and in practice that means a GS1 number in EAN-13 or UPC-A format.
- Code 128: holds letters, numbers and punctuation in a compact symbol. It is the best general-purpose choice for stock codes, asset tags, order numbers, library cards and shipping labels.
- EAN-13: the 13-digit barcode on most retail products in the UK, Europe and much of the world. It holds digits only and must use a number licensed from GS1.
- UPC-A: the 12-digit retail barcode used mainly in the United States and Canada. Modern UK tills read it too, as it is really an EAN-13 with a leading zero.
- Code 39: an older symbology holding capitals, digits and a few symbols. It is wider than Code 128 for the same data, but some warehouse, automotive and government systems still require it.
Retail barcodes need GS1 UK numbers
Anyone can draw an EAN-13 barcode, but the number inside it has to be unique in the world. That uniqueness is managed by GS1, a not-for-profit standards body. In the UK, businesses join GS1 UK, which licenses them a company prefix. From that prefix you create a Global Trade Item Number, or GTIN, for every product and variant you sell, such as each size and colour.
Supermarkets, high street chains and most wholesalers check that the barcode on a product belongs to the company selling it. Amazon and other large marketplaces also check GTINs against the GS1 database and may reject or remove listings whose numbers do not match. That is why cheap barcode numbers sold by resellers are a risk: they may have been licensed to another company years ago, so your product can clash with someone else's on a retailer's system.
This generator is happy to draw any valid EAN-13 or UPC-A number, which is useful for mock-ups, packaging proofs and printing barcodes for numbers you already own. It cannot issue numbers. If you are about to sell through retailers, contact GS1 UK first, and use Code 128 for anything that only needs to be read in-house.
How check digits work
EAN-13 and UPC-A numbers end in a check digit worked out from the other digits. When a scanner reads the barcode, it does the same sum. If the result does not match, it knows the read was wrong and rejects it rather than ringing up the wrong product.
The calculation is simple. Starting from the right-hand end of the number without its check digit, multiply the digits alternately by 3 and 1 and add them up. The check digit is whatever you need to add to reach the next multiple of 10. For 501234567890, the weighted sum is 90, so the check digit is 0 and the full EAN-13 is 5012345678900.
If you type the full 13 or 12 digits, the tool recalculates the check digit and tells you if it is wrong. That catches most typing mistakes, such as a mistyped digit or two neighbouring digits swapped, before a barcode goes to print. Code 128 has its own built-in check character, added automatically and hidden from the text. Code 39 has an optional mod 43 check character that you can switch on if your scanner expects it.
Code 128 and automatic subsets
Code 128 has three character sets. Set A covers capitals, digits, punctuation and control characters. Set B covers capitals, lower case, digits and punctuation. Set C packs two digits into a single symbol, which makes long numbers much shorter.
The generator chooses the subsets for you. It starts in set C when the data begins with a run of digits, switches into set C mid-way for runs of six or more digits, or four or more at the end, and uses set B for ordinary text. The result is a barcode close to the shortest possible for your data, which is easier to fit on a small label and easier to scan.
Code 128 supports standard ASCII characters only. Accented letters, the pound sign and emoji cannot be encoded, so the tool tells you which character to remove. If you need a pound sign on the label, put it in the printed text beside the barcode rather than inside it.
Size, quiet zone and print quality
A barcode only scans if the scanner can tell bars from spaces. The narrowest bar is called a module. Use a module width of at least 2 pixels on screen, and for print aim for a narrowest bar of around a third of a millimetre or wider. The nominal size of an EAN-13 is about 37.3 millimetres wide by 25.9 millimetres high, and GS1 allows scaling between 80 and 200 per cent of that. Cutting the bar height to squeeze a barcode onto packaging is a common cause of failed scans.
The quiet zone is the empty space on each side. Scanners use it to find where the barcode starts and stops, so text, borders or the edge of a label must not touch the bars. Leave at least 10 modules either side for Code 128 and Code 39. EAN-13 and UPC-A have the required margin built in.
Colour matters too. Scanners need dark bars on a light background. Black on white is best. Dark blue or dark green on white also works, but red bars are invisible to the red lasers used in many shop and warehouse scanners, and inverted barcodes with light bars on dark backgrounds fail on many devices.
SVG or PNG?
Download the SVG for anything printed. It is a vector file, so it stays perfectly sharp at any size and opens in Adobe Illustrator, InDesign, Affinity, Inkscape, Canva and most label design software. Packaging printers usually prefer vector artwork because it avoids blurred bar edges.
Use the PNG for documents, spreadsheets, websites and simple label printers that only accept images. Choose a larger scale, such as 4 times or 8 times, so the image has enough pixels to print cleanly, and never stretch a PNG unevenly, as distorting the bar widths can make it unreadable. You can also copy the SVG code and paste it straight into a web page or an HTML email template.
Whatever format you use, print a sample on the actual label stock or packaging and scan it with the scanner, till or app that will be used day to day before ordering a full run.
Examples you can copy
Check digit for EAN-13
Number: 5 0 1 2 3 4 5 6 7 8 9 0
Weights: 1 3 1 3 1 3 1 3 1 3 1 3
Products: 5+0+1+6+3+12+5+18+7+24+9+0 = 90
Check: (10 - 90 mod 10) mod 10 = 0
EAN-13: 5012345678900
Choosing a symbology
Stock code SKU-00431-BLK -> Code 128
Retail pack 5012345678900 -> EAN-13 (GS1 number)
US retail 036000291452 -> UPC-A (GS1 number)
Old system PART-7731 -> Code 39
Common mistakes to avoid
Buying cheap barcode numbers
Resold numbers may belong to another company in the GS1 database and are often rejected by retailers and marketplaces. Get numbers from GS1 UK.
Shrinking the bar height
Truncated barcodes are much harder to scan. Keep the height close to the recommended size.
Printing red or low-contrast bars
Many scanners use red light and cannot see red bars. Use black or another very dark colour on white.
Crowding the quiet zone
Text or borders right next to the bars stop scanners finding the start and end. Leave clear space on both sides.
Not testing the print
Screen previews do not show ink spread or low-resolution printing. Always scan a printed sample.
Frequently asked questions
Only with numbers licensed to your business by GS1 UK. The generator draws any valid EAN-13 or UPC-A, but retailers and marketplaces check that the number belongs to you.
Code 128. It holds letters, numbers and symbols, is compact, and is read by almost every scanner and stock system.
You can draw it here, but Amazon checks product numbers against the GS1 database, so you normally need numbers licensed to your business by GS1 UK. Check Amazon's current GTIN rules before listing.
The last digit does not match the sum of the others, which usually means a typing mistake. Check the number, or enter only the first 12 digits and let the tool add the correct check digit.
UPC-A has 12 digits and is used mainly in North America. EAN-13 has 13 digits and is used in the UK and most other countries. A UPC-A is an EAN-13 with a leading zero.
Code 128 and Code 39 can. EAN-13 and UPC-A hold digits only. Code 128 also supports lower case, while Code 39 uses capitals only.
For EAN-13, around 37 by 26 millimetres is the standard size, and GS1 allows 80 to 200 per cent of that. For internal Code 128 labels, keep the narrowest bar at about a third of a millimetre or more.
No. The barcodes are drawn in your browser, so you can make as many as you like without an account.
Free website audit
See how your site scores, free
Speed, SEO, DNS, email (SPF/DKIM/DMARC) and security in one scan, with a prioritised fix list.