Text and data

Make a barcode

Three symbologies, one box to type in, and the two things a hand-made barcode usually gets wrong done for you: the check digit is calculated or verified while you type, and the quiet zone is drawn into the file rather than left to whoever pastes it.

On this device

What the barcode says

The hint under the box updates as you type, so you find out about the check digit before you make the picture rather than after.

Code 128 carries letters and digits, any length, and needs no registration — use it for anything of your own. EAN-13 and UPC-A are retail product codes and need a number issued to you; UPC-A is the North American one.

Any ASCII text — letters, digits, spaces and punctuation. Nothing is uploaded: the code is drawn on this device.

SizeCode 128 · medium
Size

The width of the narrowest bar, in pixels. Wider scans more reliably from further away and makes a larger file; the SVG is sharp at any size regardless.

Taller bars give a scanner more chances to find a clean line across the symbol, which is why retail barcodes are as tall as they are.

What this tool does, exactly

Which one to choose
Code 128 for anything internal — asset tags, shelf locations, order numbers, batch codes — because it carries letters as well as digits and any length. EAN-13 and UPC-A only for retail products, and only with a number issued to you: those numbers identify a company, and inventing one puts your product under somebody else's identity.
The check digit
The last digit of an EAN-13 or a UPC-A is arithmetic over the others, and a scanner recomputes it on every read — which is how a barcode survives a scratch, a smudge and a bad angle without ever returning the wrong number. Type twelve digits and the thirteenth is calculated; type thirteen and it is checked, with the correct value named if it disagrees.
The quiet zone
The blank margin either side is part of the symbol, not padding: it is what the scanner measures the narrowest bar against. A barcode pasted flush against a table edge or a coloured background is the commonest reason a picture that looks perfect will not read. It is drawn into every file this tool produces.
What it checks
Both files are opened again from their own bytes and compared with the symbol that was drawn, module by module, before any download exists. Separately, every bar pattern this tool can produce is held by a test against the output of Barcode Writer in Pure PostScript, which is a completely independent implementation of the same standards.
Printing, which is where they fail
Scale matters more than resolution: a retail EAN-13 is meant to be about 37 mm wide, and shrinking one below roughly 80% of that stops being reliable. Print black on white, avoid glossy laminate, and never stretch the image horizontally — the widths of the bars are the data, so a squeezed barcode is a corrupted one. Take the SVG when it is going to be printed.

About this tool

Can I make up my own EAN-13 or UPC-A number?

You can make the picture, and you should not use it on a product for sale. Those numbers are issued: the first digits identify a company, through GS1 in most countries, and a made-up number either collides with a real product or is rejected by the retailer's system. For anything inside your own business — stock, assets, files, shelves — Code 128 is the right answer and needs no registration at all.

What is the difference between a barcode and a QR code?

A barcode holds its data in the widths of vertical bars, so it is read along one line and holds a short number. A QR code is a grid read in two dimensions, holds far more, and carries error correction so it survives damage. If the destination is a till or a stock system, it wants a barcode; if the destination is a phone, it almost certainly wants a QR code, and this site has a tool for that too.

Why will my printed barcode not scan?

Almost always one of four things: it was printed too small, it was stretched horizontally so the bar widths no longer mean what they say, there is not enough blank space either side, or it is printed on something shiny that scatters the light. Scale it proportionally, keep the quiet zone that is already in the file, print black on plain white, and take the SVG so the edges stay hard.

What can Code 128 actually hold?

Any ASCII text — capitals, lower case, digits, spaces and ordinary punctuation — and as many characters as you like, though the symbol grows wider with every one. It switches internally between three modes to stay compact, which is why a run of digits is packed two to a symbol, and none of that is anything you have to think about. Anything outside ASCII, an accented letter for instance, is refused rather than mangled.

Is there a number printed under the bars?

For EAN-13 and UPC-A, yes — it is drawn into the image in the grouping the standard prints it in, because a retail label without its human-readable number is not a conforming label. For Code 128 there is no standard printed form, and this tool does not invent one: it carries arbitrary text, and a caption is something to add wherever you place the image.

Is anything sent anywhere?

No. The encoding, the drawing and the read-back check all happen in this browser tab, and this site has no server to send anything to. Product codes are frequently confidential before a launch, which is a good reason not to type one into somebody else's website.

More text and data tools · All 31 · How they work