Generators
Barcode Generator
Generate Code 128, EAN-13, UPC-A and Code 39 barcodes in your browser. Check digits are worked out for you, and every barcode downloads as PNG or SVG.
EAN-13 barcode generator
Retail products worldwide, and ISBN-13 for books. Type 12 digits and the check digit is added; type all 13 and it is verified.
0 / 12 digits
Type 12 digits above, or .
Pick a barcode type in the row above, type the number, and the barcode appears as you type. Everything happens in this browser — the number you type is not sent anywhere, and neither file that comes out has been near a server.
The part worth slowing down for is the check digit. Four of the five things that go wrong with a home-made barcode are arithmetic, not artwork, and they are invisible until somebody points a scanner at the printed label. This page computes the check digit where the symbology has one, verifies it where you typed it yourself, and refuses to hand you a file while the number in the box cannot encode.
EAN-13 barcode generator
EAN-13 is the barcode on almost every retail product outside North America,
and it is also how an ISBN reaches a bookshop till: a 13-digit ISBN starting
978 or 979 is an EAN-13, and the barcode on the back of a book is exactly
this symbol.
Thirteen digits, of which the last is computed. Type the first twelve and the
tool appends the thirteenth; type all thirteen and it checks the one you gave
it and says so in the Check digit figure. If you paste a number with spaces
or hyphens in it — off a wrapper, or off a copyright page — the separators are
stripped and the status line says how many went.
The first digit is not encoded as bars of its own. It is carried in the parity of the six digits on the left of the centre pattern, which is why an EAN-13 is 95 modules wide rather than the 102 you would expect from thirteen seven-module digits, and why the leading digit is printed outside the symbol to the left of the first guard bar rather than underneath anything.
UPC-A barcode generator
UPC-A is the twelve-digit form used in the United States and Canada. Type eleven digits and the twelfth is computed for you.
Underneath, a UPC-A is an EAN-13 with a leading zero: the bar pattern this
tool draws for 036000291452 is byte-for-byte the pattern for the EAN-13
0036000291452. That is a genuinely useful fact rather than trivia. It is why
a European scanner reads an American product without being told anything, and
it is why the fix for eleven digits pasted into the EAN-13 field is to add a
zero at the front rather than to retype the number. If you do that here, the
tool offers both routes as buttons.
The visible difference is the artwork. UPC-A prints its first and last digits outside the guard bars at full height, so the two ends of the symbol look taller than an EAN-13's, and its blank margin is nine bar widths at each end rather than eleven-and-seven.
Code 128 barcode generator
Code 128 is the one for cartons, shipping labels and anything a logistics
system generated rather than a shop. It carries the whole printable ASCII
range — letters, digits, punctuation, spaces — so PO-48821-BOX3 goes in
exactly as typed, up to 48 characters.
It has a check symbol, but you will never see it: it is computed as a weighted
sum over the encoded values, drawn as an extra eleven-module block before the
stop pattern, and deliberately not printed under the bars. Nobody re-keys a
Code 128 check symbol by hand, so putting it in the human-readable line would
only invite somebody to type it into a system that is not expecting it. The
Check digit figure says "inside the symbol" for exactly this reason.
Length is the thing to watch. Each character costs eleven modules, so a 48-character value at 0.33 mm per bar comes to roughly 192 mm of symbol — wider than a 4 × 6 inch shipping label, before the margins. Keep carton references short.
Code 39 barcode generator
Code 39 is the oldest of the four and the one to reach for when the label
never leaves your own building: asset tags, equipment plates, shelf edges,
internal job numbers. It holds uppercase letters, digits and the six symbols
- . $ / + % plus space, and it needs no check character at all — its
structure already makes a single misread bar detectable.
That last point is why the mod-43 check character here is a checkbox rather than automatic. Some inventory systems require it and some reject it, and turning it on changes both the symbol and the printed text, because a Code 39 tag exists to be read back by a person as often as by a scanner.
The trade is density, and it is worth being exact about because the Width
figure under the preview will tell you. This tool draws Code 39 at a 2:1
wide-to-narrow ratio, so a character is twelve modules plus a one-module gap —
thirteen against Code 128's eleven, about 18% more per character. Over a whole
symbol the gap is smaller than that, because Code 128 spends eleven modules on
a check symbol Code 39 does not have: type the same ten characters into both
and you will read 175 modules against 165, about 6%. At the 3:1 ratio some
generators use, a Code 39 character is sixteen modules and the difference is
real — which is why 2:1 is the right default, and it is read correctly by any
scanner made this century.
SVG barcode download: what the X-dimension does when the file is resized
Both files hold the same drawing. The difference is what happens to the narrow-bar width — the X-dimension — after the file leaves here.
Everything about whether a barcode reads is a ratio of one bar to the next, so a symbol survives being made bigger or smaller as long as every element scales by the same factor. The SVG barcode download carries real millimetre dimensions on the outside and pure module units on the inside, which means a layout program can place it at any size and every bar stays in proportion. The PNG cannot promise that: it is a fixed grid of pixels, so enlarging it forces the printer to invent edge pixels, and each bar picks up a fraction of a pixel independently of its neighbours. Bar widths that were equal come out unequal, and unequal bar widths are precisely what a verifier grades down.
The failure worth knowing about is the one that does not look like a failure. Drag a barcode image by a corner handle and it stays readable to you. Drag it by a side handle and it is now stretched in one axis only — the bars are narrower relative to their height, the ratios between them are unchanged, and it still looks completely normal on screen. A laser scanner sweeping it horizontally is measuring exactly the axis you squashed. Use the SVG for anything going to print, and if you must resize by hand, hold the aspect ratio.
The quiet zone is at the two ends, and it is measured in bar widths
A linear barcode is read by a beam crossing it left to right, so the blank space that matters is at the two ends of the bar pattern, not evenly around it. That blank run is how a scanner knows where the symbol starts and stops, and it is part of the symbol — the width figure under the preview includes it.
It is specified as a multiple of the narrow bar, never as a fixed distance, which is the part that catches people out. A 0.26 mm EAN-13 needs a smaller margin in millimetres than a 0.66 mm one, and both need the same margin in bar widths. The multiples differ by symbology, too: Code 128 and Code 39 want ten bar widths at each end, UPC-A wants nine at each end, and EAN-13 is asymmetric at eleven on the left and seven on the right.
Retail artwork has a convention for this that is worth recognising. On a
printed EAN-13 you will often see a > character sitting just outside the
right-hand end of the symbol. That is not decoration and it is not part of the
number — it is a light margin indicator, printed to show a designer exactly
where the blank area ends so nobody trims into it while tightening a layout.
The preview above achieves the same thing differently: the white rectangle
around the bars is the symbol's own area, sitting on a tinted panel, so the
margin is visible as something the barcode owns rather than as page
background.
Reading the figures under the preview
Encoded is the value actually in the bars, with the check digit highlighted
where one was added — this is the string to put in a spreadsheet, and it is
what Copy number copies, which is not always what you typed. Width gives
the symbol in modules and in millimetres at the bar width you chose. Bars
counts the printed bars, which is a quick way to see that a symbol is complete
rather than truncated.
Under the download buttons, the size line states the PNG's real pixel dimensions and the bar width it actually achieved. Those two can differ from what you asked for by a fraction of a percent, because the raster is computed so that every bar lands on a whole device pixel at 600 dpi rather than being rounded independently. The number shown is the achieved one.
Questions
- What is a barcode check digit and why does it matter?
- It is the last digit of a retail barcode number, and it is not part of the product identifier — it is arithmetic over the digits in front of it. A scanner recomputes it from what it just read and compares. If the two disagree, the read is discarded and the beep never happens, which is what stops a smudged or half-covered symbol being accepted as a different product. That makes it the single most common reason a home-made retail label fails: somebody types eleven digits of a UPC they read off a wrapper, adds a twelfth from memory or from a neighbouring product, and produces a symbol that draws perfectly and is rejected at the till. Type 12 digits for EAN-13 or 11 for UPC-A and this tool computes the last one. Type the full number and it tells you whether the one already on the end is the one the arithmetic gives.
- Which barcode type should I use?
- It is decided by where the label ends up, not by preference. A product sold through shops needs EAN-13 (or UPC-A in North America), because the till looks the number up in a catalogue and only those formats hold a number that catalogue understands. A carton, a pallet label or anything moving through a courier wants Code 128 — it takes letters as well as digits, packs them tightly, and is what shipping systems already expect. An asset tag, a shelf location, a returns slip or anything read only inside your own building can be Code 39, which is the easiest to key by hand and the most forgiving of a badly printed narrow bar. If you only need something a phone camera can read and no external system has to recognise the number, a QR code holds more in less space and is the better answer.
- Can I make my own EAN-13 or UPC-A numbers for products I sell?
- You can generate the symbol for any number, and this page will happily draw one — but the number itself is not yours to invent if the product goes into retail. The leading digits of a real EAN-13 are a company prefix issued by GS1, and a shop's catalogue resolves them back to a registered owner. A made-up number will scan and will then either fail to match anything or, worse, match somebody else's product. For a closed loop — your own stockroom, your own market stall, your own scanner — an invented number is fine and very common, and Code 128 or Code 39 is a better fit for it anyway because neither carries an ownership claim.
- Why does my printed barcode scan on screen but not on paper?
- Almost always the bars have lost their edges. A thermal label printer is one-bit — every dot is on or off — so a background that is not pure white gets dithered into scattered dots, and a scanner sweeping across them reads speckle as narrow bars. Printing from a resized image does the same thing by blurring the boundary between a bar and the space beside it. Three things fix nearly every case: download the SVG and let the printer driver rasterise it at its own resolution rather than scaling a small PNG up, keep the blank margin at both ends of the pattern, and do not print bars in a colour other than black on white. Red bars in particular are invisible to a red-laser scanner, which reads them as blank paper.
- How wide should the narrow bar be when I print a barcode?
- The narrow bar width — the X-dimension — is the measurement everything else follows from, and 0.33 mm is the nominal figure for a retail EAN-13 or UPC-A. GS1 allows the whole symbol to be scaled between 80% and 200% of that, so 0.26 mm to 0.66 mm, and shrinking below the floor is the usual cause of a symbol that grades badly on a verifier without looking wrong. For Code 128 and Code 39 there is no fixed nominal, so match the printer instead: 0.25 mm is one dot on a 203 dpi label printer, 0.33 mm is a safe general-purpose size, and 0.5 mm is worth it if the label is read from more than arm's length. The size readout under the download buttons shows the real millimetre dimensions for whatever you pick.