Make a barcode you can print and scan

Generate Code 128 or EAN-13 barcodes free as PNG, with the check digit worked out for you. No signup, and your product data never leaves the browser.

Options

Code 128 for anything internal — references, assets, shelves. EAN-13 only for the number printed on retail products.

Code 128 takes any printable ASCII. EAN-13 takes exactly 12 digits and adds the thirteenth itself.

px

Taller bars are easier for a hand scanner to catch at an angle.

px

The width of the narrowest bar. Below two pixels, many printers blur it into its neighbour.

So a human can read and type it when the scanner will not cooperate.

Results appear here. Nothing is uploaded.

    How it works

    Code 128 maps each character to one of 106 eleven-module patterns, adds a checksum that is a position-weighted sum of the symbol values taken modulo 103, and closes with a thirteen-module stop pattern. EAN-13 is stricter: the check digit comes from alternating weights of one and three across the first twelve digits, and the leading digit is not drawn at all but encoded in which of two alphabets each of the next six digits uses.

    What to watch out for

    An EAN-13 number has to be allocated to you, not invented

    The thirteen digits identify a company and a product through GS1, the body that issues them. Making one up produces a barcode that scans perfectly and means somebody else's product, or nothing at all. For internal use — stock, assets, shelves, files — Code 128 is the right choice and needs no registration.

    Numbers encode wider here than they need to

    Code 128 has a mode that packs two digits into one symbol, which halves the width of a long number. It is not implemented, because it means tracking mode switches and every extra path is another way to produce a barcode that scans as something other than what it shows. A wider symbol is a cost you can see; a wrong one is not.

    Printing decides whether it scans, more than any setting here

    Bars that are too narrow bleed into each other on an inkjet, and scaling the image in a word processor can drop entire columns of pixels. Print at 100% with the narrowest bar at least 0.25 mm, keep the white margin at both ends, and never stretch the image horizontally on its own.

    Accented letters and Cyrillic cannot go in

    Code 128 encodes printable ASCII only, so an item name with an accent, a Cyrillic reference or an emoji is refused rather than silently mangled. A QR code holds any text and is the answer where the value is not plain ASCII.

    Limits

    Files up to about 1 MB work reliably. Beyond that, the ceiling is your device's memory rather than any rule we impose — the work happens on your own machine. Tested in Chrome 140, Firefox 143, Safari 18.

    Which of the two you want

    Code 128 encodes any printable ASCII text and is what you want for anything internal: asset tags, shelf labels, job numbers, file references, event tickets, library stock. Nobody has to issue you anything. The barcode is as long as the text you put in it.

    EAN-13 is the thirteen-digit number on the back of a retail product. It is fixed length, digits only, with the last digit computed from the other twelve.

    If you are labelling your own things, use Code 128. If you are putting a product on a shop’s shelf, you need EAN-13 — and you need the number to have been issued to you.

    The part people get wrong about EAN-13

    An EAN-13 is not a format you can fill in. It is an identifier allocated through GS1, the organisation that issues company prefixes, and the digits say which company and which product.

    Typing thirteen plausible digits gets you a barcode that scans flawlessly and either means nothing or means somebody else’s product. Shops will reject it, and if it happens to collide with a real allocation the result is worse than rejection.

    So this tool will draw one, because there are legitimate reasons to — reprinting a damaged label, testing a scanner, checking a number you were given. It will not pretend an invented number is usable.

    What it does do is work out the check digit. Give it twelve digits and it appends the thirteenth. Give it thirteen and it verifies the last one, telling you if the number is mistyped — which is exactly what that digit exists for.

    Why the check digit exists

    The final digit of an EAN-13 is not part of the identifier. It is arithmetic on the other twelve: multiply them alternately by one and three, add them up, and the check digit is whatever takes the total to a multiple of ten.

    That single digit catches every single-digit error and most transpositions of adjacent digits, which are the two mistakes people make when reading a long number aloud or typing it in. It is a small, old, very effective idea.

    Printing, which is where barcodes actually fail

    Almost every barcode that will not scan was fine as a file and broken by the printing.

    Print at 100%. Scaling to “fit the page” resamples the image and can delete whole columns of pixels, which merges two bars into one. Keep the narrowest bar at 0.25 mm or wider — that is roughly two pixels at 200 dpi, which is why the width control here starts at two.

    Leave the white space at both ends alone. Like a QR code’s margin, it is how the scanner finds where the symbol begins.

    And never stretch a barcode horizontally on its own. Taller is harmless and sometimes helps; wider without taller changes the bar ratios and is precisely what the reader measures.

    Nothing is uploaded

    The patterns are computed and drawn in your browser. Stock lists, asset registers and customer references are ordinary things to put in a barcode and ordinary things not to hand to a stranger’s server on the way to a PNG.

    Your files never leave your browser. Last updated 2026-08-02.