What is a barcode generator?
A barcode generator turns a value — a product code, an order number, a short piece of text — into a barcode: the black and white stripes a scanner reads in a second. Type a value, pick a format, press the button, and the barcode appears below, ready to download as an SVG. The code is drawn entirely in your browser: nothing you type is sent to a server.
Barcodes show up everywhere because they remove typing. Shops scan them at the till instead of keying in prices. Warehouses scan them to track stock. Libraries scan them to lend books. Tickets, parcels, and ID badges all use them. A barcode that holds a product code is the most common kind, but the same stripes can hold an order number, a shelf location, or any short value a scanner needs to read fast.
This generator gives you three formats: CODE128, the compact general-purpose format that holds any text; CODE39, the older format for capital letters, digits, and a few symbols; and EAN13, the retail format printed on almost every product sold in a shop. Barcode rendering by JsBarcode (MIT), a small library stored on this site, so it works offline once the page has loaded.
How a barcode generator works
A barcode is a set of bars of different widths, and the widths encode the value. Each format has its own alphabet: CODE128 can encode all 128 ASCII characters, CODE39 can encode capital letters, digits, and the symbols - . $ / + % and space, and EAN13 can encode exactly 13 digits. The generator picks the right encoding for the format you chose and draws the bars as an SVG — a vector image that stays sharp at any size.
EAN13 carries a check digit, and this page works it out for you. Give it 12 digits and it appends the 13th: add the digits in odd positions, add three times the digits in even positions, and the check digit is what brings the total up to a multiple of 10. For 123456789012 the odd positions add to 26, the even positions add to 22, three times that is 66, the total is 92, and the check digit is 8 — so the full code is 1234567890128.
The other two formats have no check digit. CODE128 encodes the value exactly as typed, and CODE39 uppercases it first, because it has no lowercase letters. The preview below the results box is the real barcode, drawn by JsBarcode from the same value the results box shows, and the Download SVG button saves that exact drawing.
CODE128, CODE39, and EAN13 explained
CODE128 is the default here, and it is the right choice for most jobs. It holds any text — letters, digits, symbols — and it packs the bars tightly, so a long value still fits in a short barcode. Order numbers, tracking codes, and internal IDs all suit CODE128, because it never rejects a character you type.
CODE39 is the older format, and it shows its age. It holds capital letters, digits, space, and six symbols, and it is wider than CODE128 for the same value, because each character takes more bars. It survives because warehouses and factories have used it for decades and their scanners still read it. Use it when the receiving system asks for CODE39 by name, and nowhere else.
EAN13 is the retail format: 13 digits, printed on nearly every product in a shop, with the number printed under the bars so a human can read it too. The first digits say which country the code was issued in, the middle digits say which company and product, and the last digit is the check digit. If your value is a product code, EAN13 is the format the till expects — and if it is not 12 or 13 digits, this page will say so instead of drawing a broken barcode.
A worked example: a barcode for 123456789012
Take the default value, 123456789012, in the default format, CODE128. Press Generate Barcode and the results box shows the value 123456789012, the format CODE128, and the note that the preview appears below. The preview draws the bars for those 12 digits, with the number printed underneath, and the Download SVG button saves it.
Now switch the format to EAN13 and press again. The value is still 12 digits, so the page appends the check digit: 123456789012 becomes 1234567890128, and the note says the check digit was added. The preview draws the EAN13 bars for the full 13 digits. That is the code a shop till would scan.
Try a third one. Type hello-123, pick CODE39, and press again. The value becomes HELLO-123 — uppercased, because CODE39 has no lowercase — and the note says the preview appears below. Type hello_123 instead, with an underscore, and the page refuses: CODE39 allows only A–Z, 0–9 and - . $ / + %, and the underscore is not one of them. The note says so, and no broken barcode is drawn.
Who uses a barcode generator, and why
Shop owners are the biggest users. A product without a barcode cannot be scanned at the till, and a product with a wrong barcode scans as the wrong product. This page makes the barcode for a product code in seconds, and the SVG download prints sharply at any size — on a label, on a shelf edge, or on the product itself.
Warehouse and stock teams are the second group. Every shelf, every bin, and every parcel gets a code, and the barcode is what makes the scan fast and the count right. A team that labels a new shelf prints the barcode from a page like this one, sticks it on, and scans it to confirm it reads back correctly before the stock arrives.
Event organisers and small offices are the third group. Tickets, badges, and asset tags all carry barcodes, and a generator that draws them in the browser means no special software and no account. If the code needs to sit inside a larger design, an image resizer can shrink the downloaded SVG to the exact width the layout needs.
Barcode generator vs QR code generator
A barcode generator and a QR code generator both turn text into something a camera can read, but they work in different places. A barcode holds a short value — a product code, an order number — in stripes that a laser scanner reads in one pass. A QR code holds much more — a link, a message, Wi-Fi details — in a square grid that a phone camera reads.
Barcodes win where scanners are laser-based and the value is short: tills, warehouses, and stockrooms, where a scanner reads thousands of codes a day and the code is always a number. QR codes win where the reader is a phone and the value is a link or a message: posters, menus, tickets, and business cards, where the square holds more than stripes ever could.
Use a barcode when the value is a code and the reader is a scanner. Use a QR code when the value is a link and the reader is a phone. A UUID generator makes the unique IDs that often sit inside either one — a random ID in a barcode on a parcel, or the same ID in a QR code on a ticket.
Common mistakes with barcodes
The most common mistake is printing too small. Bars that are too narrow blur together on a cheap printer, and a scanner that cannot tell two bars apart cannot read the code. Print at least 3 centimetres wide for a short code, and larger for a long one, and always scan the printed copy — not just the screen — before you print a thousand labels.
The second mistake is low contrast. Barcodes need black bars on a white background. A grey barcode on a coloured label, or a barcode printed over a photo, fails on many scanners. Black on white scans best, and if you must use colour, keep the bars dark and the background pale, and test it on the actual scanner that will read it.
The third mistake is the wrong format. An EAN13 code with 11 digits is not a barcode, it is an error, and a till will reject it. A CODE39 barcode with lowercase letters is not a barcode either, because CODE39 has no lowercase. This page checks the value before it draws, and the note row says what is wrong — read it instead of printing a barcode that no scanner can use.
The fourth mistake is reusing a product code. EAN13 codes are issued per product, and two products sharing one code will ring up as the same item at the till. Generate a new code per product, keep a list of which code belongs to which product, and never guess a code that looks free.
How to use this barcode generator
First, type or paste your value into the box. The default is 123456789012, so you can press the button straight away to see a working barcode. Next, pick a format. CODE128 is right for most values; pick EAN13 for a retail product code, and CODE39 only when the receiving system asks for it by name.
Then press Generate Barcode. The results box shows the encoded value, the format, and a note — including whether a check digit was added for EAN13 — and the barcode appears below, with a Download SVG button. SVG stays sharp at any size and is best for print; if you need a PNG for a document, an image compressor can slim down the photo it sits next to, but keep the barcode itself as SVG.
Your value never leaves your device. The barcode is drawn in your browser by JsBarcode, a small library stored on this site, so it works offline once the page has loaded and no one else sees what you encoded. If the barcode will go on something public, scan it once with a real scanner before you print it — that one check catches almost every mistake.