Barcode Generator

Type what it should say, choose a format, and take away a barcode that scans.

A check digit is added for you where the format requires one.

🔒 Runs entirely in your browser — nothing you type is uploaded or stored on a server.

This is a real barcode encoder, not a picture of one. The pattern tables for Code 128, EAN-13, UPC-A, EAN-8 and Code 39 are built into the page, the check digit is calculated from what you typed, and the bars you see are the bars a scanner reads. Type your value, pick a format and download a PNG for printing or an SVG for artwork that stays sharp at any size.

Also on Txtset: make a QR code instead.

Nothing is uploaded. There is no server behind this page and no account. Stock codes, asset tags and order numbers are exactly the sort of thing that should not be passing through somebody else’s machine on the way to a label printer, and here they do not — you can disconnect from the internet once the page has loaded and it still works.

The formats are the ones people actually need. Code 128 carries letters, digits and punctuation and is what most warehouses, couriers and asset registers use. EAN-13 is the retail barcode outside North America and UPC-A is its North American twin — give the first 12 or 11 digits and the final check digit is worked out for you. EAN-8 exists for packs too small for a full EAN-13. Code 39 is the old industrial format that many older readers still expect.

Need a two-dimensional code that can hold a URL, a Wi-Fi password or a whole vCard? Use the QR Code Generator instead — a linear barcode holds a number or a short string and nothing more.

How to use

  1. Choose the barcode format. Code 128 is the safe answer if you are labelling your own things rather than selling them in shops.
  2. Type what the barcode should say. Retail formats take digits only; Code 128 takes letters and punctuation too.
  3. Set the bar width and height. Wider bars are more forgiving of a cheap scanner and a rough print.
  4. Leave “print the number underneath” on if a person will ever need to read or key it by hand.
  5. Download the PNG to drop into a document, or the SVG if it is going to be resized or sent to a printer.

Examples

An asset tag
TXT-2026-0417 in Code 128 — letters, digits and a hyphen in one symbol, with a check character added automatically.
A retail product
Typing the first 12 digits of an EAN-13 fills in the thirteenth for you, and the number is printed in the split layout a real pack uses.
A long serial number
Pure digits in Code 128 pack two to a symbol, so a 16-digit code comes out roughly half as wide as the same digits in any other format.

Frequently asked questions

Will these barcodes actually scan?
Yes. The bar patterns come from the published tables for each format and the check digits are computed, not guessed. Print at a bar width of 3 or more and leave the white margin on either side alone — that quiet zone is part of the barcode, and cropping it off is the single most common reason a printed code will not read.
Which format should I choose?
Code 128 unless you are selling through shops. It holds letters as well as numbers, it is compact, and every modern scanner reads it. Use EAN-13 or UPC-A only if you have been issued a real GS1 company prefix — those numbers identify a product globally and inventing one will collide with somebody else’s.
What is a check digit and why did the number change?
The last digit of an EAN or UPC is arithmetic on the ones before it, so a scanner can tell a misread from a real code. If you give 12 digits for an EAN-13 the thirteenth is added for you. If you give all 13 and the last one is wrong, the page says so rather than making a barcode that no till will accept.
Are my codes sent anywhere?
No. The encoder is a few hundred lines of JavaScript running on your own device. Nothing you type is transmitted, logged or stored, and there is no server to send it to.
Why is the SVG better than the PNG?
An SVG is made of rectangles rather than pixels, so it stays perfectly sharp at any size — which matters because a barcode fails when its edges go soft. Use the SVG for anything going to a professional printer, and the PNG for a document or a web page.
Can Code 39 hold lower case letters?
No, and nothing here can make it. The format has 43 characters: A–Z, 0–9, space and - . $ / + %. Lower case is folded to upper case so you get a working barcode rather than an error, and the printed text shows what was actually encoded.
Why does my numeric Code 128 look so short?
Because it is. Code 128 has a numeric mode that packs two digits into each symbol, so a long run of digits takes about half the width of the same digits in any single-character format. The encoder switches into it automatically.
Is there a limit on length?
Practically, the width of your label. Code 128 and Code 39 have no fixed length, but a very long value makes a very wide barcode that is hard to print and hard to scan. The retail formats are fixed at 13, 12 or 8 digits by definition.