Barcode Generator
Make a scannable barcode (retail, warehouse or 2D) without uploading your codes.
runs entirely in your browserLetters, digits and punctuation, packed densely. The general-purpose choice for internal SKUs, asset tags and shipping labels.
More options
SKU-10482-BRendered on your device. Product codes, serial numbers and patient IDs never leave this page, unlike the generators that build the image on their own server.
Pick the symbology before you pick anything else
A barcode is not one format. The stripes are a specific encoding called a symbology, and choosing the wrong one is the single most common reason a printed label will not scan at the till or in the warehouse. Four cover almost every real job. Code 128 is the default here because it holds letters, digits and punctuation in a compact symbol, which is what an internal SKU, an asset tag or a shipping reference actually needs. Code 39 is older and wider and only carries capitals, digits and a handful of symbols, but practically every scanner ever built reads it, which is why it survives in manufacturing and defence.
EAN-13 and UPC-A are the retail pair, and they are not general-purpose: they are fixed-length numbers with a built-in check digit, 13 digits for EAN-13 and 12 for UPC-A. EAN-13 is used across most of the world, UPC-A in North America, and the two are close relatives: a UPC-A is an EAN-13 with a leading zero.
The 2D codes solve a different problem. Data Matrix packs a lot into a square millimetres across, which is why it marks circuit boards, surgical instruments and pharmaceutical cartons. PDF417 is the wide stacked block on the back of a driving licence or a boarding pass, and it holds a paragraph rather than a number. Aztec needs no quiet zone around it, so it survives being printed to the edge of a rail or airline ticket. Micro QR is a smaller QR variant for when there is genuinely no room; for an ordinary QR code, the QR code generator on this site is the better page.
The check digit, and why this page argues with you about it
EAN-13 and UPC-A end in a check digit that is calculated from the digits before it. Multiply the digits alternately by 3 and 1, working right to left from the digit next to the check digit, add the results, and the check digit is whatever takes that total up to the next multiple of ten. For 590123412345 the total comes to 83, so the check digit is 7 and the full code is 5901234123457.
That single digit is the format's error detection: a scanner that reads a code whose check digit does not match the rest simply refuses it rather than reporting the wrong product. It is also why this page will not quietly draw a barcode from a number that fails the test. Type the first 12 digits of an EAN-13 and it works out the thirteenth and offers it in one tap. Type all 13 with one digit wrong and it names the digit it should have been. A generator that draws whatever you type produces a barcode that looks perfect, prints perfectly, and is rejected by the first scanner that meets it.
Code 128 has a check character too, but the encoder calculates it and it is never typed or displayed, so there is nothing to get wrong. Code 39 has an optional one that most users omit.
Printing something that actually scans
Two things break more printed barcodes than any encoding mistake. The first is the quiet zone, the blank margin either side of the symbol. A scanner uses it to find where the code begins, so a barcode cropped tight to its bars, or butted against a border on a label template, fails on a surface that looks fine to a human eye. The quiet zone control here defaults to a margin rather than to zero for that reason.
The second is resolution. A barcode scaled up from a small PNG has soft, uneven bar edges, and the narrow bars are the ones that decide whether it reads. Download the SVG whenever the code is going to print: it is vector, so it stays exact at any size, and print shops generally ask for it. Use the PNG for screens, email and anywhere an image is expected. Both come from the same encoder with the same settings.
Contrast matters more than colour. Scanners read the difference between bars and background, most reliably as dark bars on a light background, so the safest choice remains black on white, and red bars in particular are close to invisible to some older red-laser scanners. If you change the colours, test-scan the result with a real device before committing it to a print run.
The batch tab takes one value per line and returns a zip, with each file named after its own value rather than a counter, so a folder of sixty labels is still navigable. Values that would produce the same filename get numbered instead of overwriting each other.
Sunrise 2027, and the QR code that goes next to the barcode
GS1, the organisation that issues retail barcode numbers, has asked that by the end of 2027 every retail checkout in the world be able to read a product's number from a 2D code as well as from the stripes. The initiative is called Sunrise 2027, and the practical consequence for anyone designing packaging is that a pack now carries two marks instead of one: the familiar EAN-13 or UPC-A, and a QR code sitting next to it that holds the same number in a format called GS1 Digital Link.
The retail pair tab does exactly that. Type a GTIN once and you get both marks in a single PNG or SVG, drawn to the rules that govern the pairing rather than simply placed side by side. The QR code is given an X-dimension 1.5 times the linear barcode's, which is the target GS1 publishes, and a quiet zone of four modules on every side. The human-readable digits stay under the stripes and are not repeated under the QR, which is what the guideline asks for when the two are adjacent.
The number inside the QR is a URL, and that is the whole point of Digital Link: one mark that a till reads as a product number and a phone reads as a web address. A GTIN in one of these URLs is always written as 14 digits with leading zeros, so a 12-digit UPC-A becomes 00036000291452. The tool pads it for you, because a QR code carrying an unpadded number scans perfectly, opens perfectly in a browser, and fails the parsing rules a compliant checkout applies. By default the link points at id.gs1.org, the resolver that answers for any number whose owner has registered it. Point it at your own domain instead if you run a resolver there.
One rule is easy to miss and is the reason this tab reports millimetres. A QR code intended for scanning at the till has to sit within 50mm of the linear barcode's centre, because that proximity is what lets a checkout keep its scanning rate up. At normal size a pair from this tool measures about 28mm centre to centre for EAN-13 and 31mm for UPC-A, comfortably inside it. But a retail barcode may legitimately be printed anywhere from 80% to 200% of nominal size, and somewhere past 160% the pair stops meeting the rule: UPC-A gets there first, at about 162%, because its printed digits sit outside both guard patterns and push the QR further out. The printed size control is there so the page can tell you which side of the line you are on before a printer does.
Why this one runs in your browser
Most of the free barcode generators on the web build the image on their own server: the number you type is sent off, rendered, and sent back as a picture. For a test code that is harmless. For a real one it means your unreleased SKUs, your serial number ranges, your asset tags or your patient identifiers have been handed to a third party whose retention policy you have not read. Several of the larger sites are also lead-generation funnels that ask for an email before they will let you download the result.
This page loads the encoder into your browser and draws the code there. Nothing is uploaded, there is no account, and the tool keeps working with the network off once the page has loaded. The engine is bwip-js, the JavaScript port of BWIPP, which is the reference implementation behind a great many barcode tools, including some of the server-side ones.
fair questions
- What barcode format should I use for a retail product?
- EAN-13 outside North America, UPC-A inside it. One important caveat: this page will draw a valid, scannable EAN-13 or UPC-A from any number that passes the check-digit test, but a barcode that retailers will accept has to carry a company prefix assigned to you by GS1, the organisation that issues them. Generating the image is free; owning the number is not. For internal use (your own warehouse, your own stock system), no registration is involved and Code 128 is usually the better choice anyway.
- How is the EAN-13 check digit calculated?
- Take the first 12 digits and multiply them alternately by 3 and 1, working from right to left starting with the digit next to the check digit. Add the products, then subtract that total from the next multiple of ten. For 590123412345 the total is 83, so the check digit is 7. UPC-A uses the same rule over its first 11 digits. Enter the digits without the last one here and it is worked out and offered in one tap.
- What's the difference between Code 128 and Code 39?
- Code 128 encodes the full ASCII set and packs it densely, so it produces a shorter symbol for the same data, which makes it the practical choice for most internal SKUs and shipping labels. Code 39 only carries digits, capital letters, space and the symbols - . $ / + %, and it takes noticeably more width to say the same thing. Its advantage is age: it is read by essentially every scanner in existence and is still specified in some manufacturing, automotive and defence standards.
- Can I print these barcodes and will they scan?
- Yes, with two conditions. Download the SVG for anything going to print so the bar edges stay exact at any size, and leave the quiet zone (the blank margin either side) intact rather than cropping to the bars, because scanners use it to find the symbol. Keep strong contrast, ideally dark bars on a white background. Then test-scan the printed result with a real device before running the whole batch.
- What is Sunrise 2027 and do I need a QR code on my product now?
- Sunrise 2027 is GS1's target for retail checkouts worldwide to be able to read a product's GTIN from a 2D code, such as a QR code carrying a GS1 Digital Link URI, as well as from the usual linear barcode, by the end of 2027. It is a capability deadline for retailers rather than a legal requirement for you. In the meantime a pack that carries a 2D code still needs the linear barcode alongside it, because most tills cannot yet read the 2D one. That is what the retail pair tab produces: both marks together, from one number.
- How close does the QR code have to be to the barcode?
- Within 50mm of the linear barcode's centre, measured centre to centre. GS1 tested this and found that proximity is what allows a checkout to hold its target rate of roughly 40 to 70 items per minute, because the operator is aiming at one region of the pack rather than two. The retail pair tab places the QR code directly beside the barcode with both quiet zones intact and reports the actual distance in millimetres, so you can see the figure rather than assume it. Print the pair large enough and it will exceed 50mm, and the page says so when that happens.
- What is a GS1 Digital Link URI?
- It is a web address that also encodes a product's identifiers, so one QR code serves both a checkout and a phone. The canonical form looks like https://id.gs1.org/01/05901234123457, where 01 is the application identifier for a GTIN and the digits after it are the number itself. The GTIN is always written as 14 digits, padded with leading zeros, so a UPC-A gains two and an EAN-13 gains one. Scan it with a phone and it opens a page about the product; scan it at a till with a compatible scanner and the number is extracted as a GTIN. This page pads the number and builds the URI for you, and shows you the exact string it encoded.
- Is a QR code a barcode?
- Yes, a QR code is a 2D barcode. The word barcode usually brings to mind the 1D striped kind that a laser scanner reads across, while QR, Data Matrix, PDF417 and Aztec are 2D matrix codes read by a camera. This page covers Data Matrix, PDF417, Aztec and Micro QR; for ordinary QR codes, with logos, colours and WiFi or contact payloads, use the QR code generator.
- Does anything I type get uploaded?
- No. The encoder runs in your browser and the barcode is drawn on your device, so the SKUs, serial numbers or identifiers you enter never leave the page. That is the main practical difference between this tool and most of the free generators on the web, which render the image on their own server.
related tools
- QR Code GeneratorMake a QR code that never expires — colors, a logo, PNG or SVG, nothing uploaded.
- Image ConverterConvert JPG, PNG, WebP, HEIC, and AVIF images in one place, all inside your browser.
- Image ResizerGet any image to the exact pixels or percentage you need, without uploading it anywhere.
- SVG to PNGRender any SVG to a crisp PNG at exactly the size you need, without it leaving your browser.