Type a number or a bit of text into the barcode generator below and you get the barcode straight away, as an SVG you can drop into a label, a document or a print job.
And if you have made a barcode before and the scanner would not read it, do not worry, you have not done anything wrong. You are not alone either, it is the single most common thing that goes wrong here, and the reason is almost never the number. It is the size. That is explained first, because it is the thing that decides whether the label works.
Nothing you type leaves your browser. The bars are drawn on your own computer, and the page carries on working with the network turned off.
Nothing you type is uploaded. The barcode is drawn on your own computer, and this page carries on working with the network turned off.
The reason a homemade barcode will not scan is size
Every generator on the internet, including this one, produces correct bars. So when a label fails, people assume the number is wrong and go and make another one, and that one fails too.
A barcode is not a picture. It is a physical measurement. The narrowest bar has a real width in millimetres, and the scanner is built expecting that width.
Think of it like the grooves in a key. The shape is right, but if somebody photocopies the key at 60 percent the lock will not turn, no matter how correct the shape still looks.
For an EAN-13 the narrowest bar is 0.33 mm at normal size, which makes the whole barcode 37.3 mm wide. The standard lets you print it between 80 and 200 percent of that. Below 80 percent you are outside the specification, and while a good handheld reader may still cope, a supermarket till is entitled to refuse it.
This page prints the millimetre width for whatever size you pick, and says plainly when the size you chose is outside the standard. Where it stops: it can tell you the size is legal, it cannot tell you your printer will hold that size. A cheap thermal printer at 203 dpi smears the narrow bars, and only a test print and a real scanner settle that.
The white space either side is part of the barcode
This one catches people constantly, and it looks like nothing is wrong.
The blank margin to the left and right of the bars is called the quiet zone. It is not padding that a designer added to make it look tidy. It is how the scanner works out where the barcode starts and stops. Crop it, or put a border tight against the bars, and the symbol stops working while still looking perfect on screen.
On an EAN-13 the quiet zone is eleven modules on the left and seven on the right. That is not a rounding of ten. The left side is wider on purpose, because that is the end the scanner is expected to meet first.
The SVG you download here already includes it, and the page tells you how many millimetres of it there are, so nobody trims it off by accident.
The thirteenth digit is not drawn as bars at all
Here is something genuinely odd that almost nothing explains.
An EAN-13 has thirteen digits printed under it. Count the bars and you will find room for only twelve. The first digit has no bars of its own anywhere in the symbol.
It is carried in the pattern instead. The six digits on the left half are each drawn using one of two different alphabets, and which alphabet each one uses spells out the first digit. For a barcode starting with 5, the six left digits use the pattern L G G L L G. That sequence is the 5.
It was done that way so EAN-13 could carry one more digit than UPC-A without getting any wider, which mattered a great deal when Europe adopted it and every American scanner already existed. The tool shows you which pattern your number produced.
The last digit is a sum, and this one refuses to get it wrong
The final digit of an EAN or a UPC is a check digit. It is worked out from all the others, so that a single mistyped digit produces a number that cannot exist.
Two things follow, and both are handled here:
- Paste twelve digits and the thirteenth is worked out and added for you.
- Paste thirteen and the last one is checked. If it does not add up, you get told what it should have been rather than a barcode that looks fine and fails at the till.
A lot of free generators will happily draw whatever you give them. That is worse than failing, because the label looks perfect and you only find out when somebody is standing at a checkout.
You cannot invent an EAN-13 for something you are going to sell
This is the part most barcode pages leave out, and it is the one that costs money.
A retail EAN or UPC number is not just a number. The first digits are a company prefix, issued to one business. If you make one up, it will encode perfectly, it will scan perfectly, and it will belong to somebody else. Retailers check.
So use the retail types honestly:
- Selling through shops or online marketplaces? You need a real prefix from GS1, the body that issues them. There is no way round it and no free source of genuine numbers.
- Labelling your own stock, shelves, files or equipment? Use Code 128. It holds letters and numbers, nobody owns the numbering, and your own scanner will read it happily.
- Feeding older equipment that predates Code 128? Code 39 is the one it will know. It is wider for the same data and it has no lower case.
Making an EAN-13 to test your own system is completely fine, and that is what the example number on this page is for. Putting one on a product for sale is not.
Why your Code 128 got shorter when you used numbers
Code 128 has three alphabets inside it, called A, B and C, and it switches between them as it goes.
Alphabet C is the interesting one. It packs two digits into one symbol. So eight digits take four symbols, while eight letters take eight, and the barcode comes out visibly narrower for the same amount of information.
abcdefgh 11 symbols wide
12345678 7 symbols wide
Switching alphabets costs one symbol, so it only pays from about four digits in a row. This page picks the alphabets for you and tells you which ones it used.
Where it stops, and this is honest: it produces a valid, scannable symbol every time, but it does not promise the shortest possible one in every case. Squeezing out the last symbol on a string that alternates letters and digits needs a different kind of search, and the difference is a fraction of a millimetre.
Frequently asked questions
Is my data sent anywhere?
No. Open your browser’s developer tools, go to the Network tab, and type something in. Nothing is sent. You can also disconnect from the internet and the page carries on drawing barcodes.
Why SVG and not PNG?
Because a bitmap barcode dragged smaller in a document loses the edges between the bars. On screen it still looks like a barcode. To a scanner it is mush.
An SVG carries a real width in millimetres, so a printer honours it and the bars stay sharp at any size. Word, Google Docs, Illustrator, InDesign and every modern browser all take SVG.
Which type should I choose?
If you are labelling your own things, Code 128, every time. It takes letters and numbers, it is compact, and every scanner made in the last thirty years reads it.
EAN-13 and UPC-A are for retail products and need a real issued prefix. EAN-8 is the short version for packaging too small for the full one. Code 39 is for older equipment that will not read anything newer.
Can it make QR codes?
No, and that is deliberate rather than an oversight. A QR code is a different thing built for a different job: a phone camera pointing at a screen or a poster, rather than a laser sweeping across a moving product.
Putting both behind one control tends to leave people choosing the wrong one for what they are actually doing.
The barcode prints but my scanner reads nothing
Work through these in order, because they are in order of how often each one is the answer:
- It is printed too small. Print it again at 100 percent with no scaling in the print dialog, which is the setting that quietly shrinks everything.
- The quiet zone got cropped. Give it a clear white centimetre either side and try again.
- It is not black on white. Red bars are invisible to a red laser, and a shiny or coloured label kills the contrast the reader needs.
- The scanner does not know that type. Many readers ship with Code 39 or EAN switched off. It is a setting, usually changed by scanning a barcode out of the manual.
If you have any issues, you can ask me via comment, and I will love to help you out.