Supports CODE128/EAN-13 and other encodings
Different barcode formats have their own input rules — EAN-13 and UPC-A are international retail barcode standards requiring exactly 13 and 12 digits respectively, while CODE128 and CODE39 are more flexible and support letters and numbers. Everything is generated locally in your browser, with no network lookup required.
This tool encodes text or numbers into a one-dimensional barcode, draws it on the page and lets you download it as a PNG. It supports four formats: CODE128, EAN-13, UPC-A and CODE39, and shows the human-readable text under the bars. It is important to be clear about scope. It only encodes and draws. It does not look anything up in a product database and it does not register product codes for you. Retail EAN-13 and UPC-A numbers have prefixes assigned by official numbering bodies, so a number you make up may scan perfectly well without being a legitimately registered product code.
The page uses the open-source JsBarcode library. We ran several inputs through that same library to see what happens. CODE128 accepts 123456789012 and abc-123 but cannot encode Chinese characters. CODE39 accepts abc-123 and ABC 12 with a space, and it converts lowercase letters to uppercase, so the text under the bars becomes ABC-123. EAN-13 has a special case. Entering the 12 digits 123456789012 makes the library append a check digit, giving 1234567890128. Entering the full 13 digits 1234567890128 also works, but 1234567890123, whose last digit is wrong, fails. UPC-A behaves the same way: the 11 digits 12345678901 gain a check digit and become 123456789012, the 12 digits 123456789012 pass, and 123456789013 with the wrong check digit fails. So "needs 13 digits" on the format button is only shorthand; 12 digits also work, and the thirteenth is calculated for you. The red error message states this rule too.
For internal IDs, warehouse locations or asset tags, CODE128 is usually the most convenient: it encodes letters, digits and common symbols and is more compact than CODE39. CODE39 has a limited character set but is still used by many older systems. EAN-13 and UPC-A are for retail products and the numbers should come from the official numbering system. Do not use invented numbers to pose as real products.
The last digit of an EAN-13 is a check digit calculated from the first 12. If you enter all 13 digits and the last one does not match the calculation, the code is rejected. You can fix this by entering only the first 12 digits so the tool fills in the check digit, or by checking whether you have copied the number incorrectly.
No. The readable text under the barcode is always shown and there is no option to hide it. CODE39 shows letters in capitals.
A PNG bitmap exported directly from the canvas on the page. Because it is a bitmap, enlarging it for print makes it blurry, so place it in your design software at its original size or an exact multiple and avoid stretching it.
The barcode is generated entirely in your browser. The page loads the JsBarcode library, which is bundled with the site, only when needed. It does not send what you type to a server and it does not look up product information online. The downloaded image is saved to your device by the browser. Nothing is stored between visits, and the input returns to its default value when you reload.