Barcode Generator
Generate 1D barcodes in Code 128, EAN-13, UPC, and Code 39 formats. Customize size and labels. Download as SVG.
Add this tool to your own site with one line of HTML. Free forever — just keep the small credit link.
How to use Barcode Generator
- Choose a barcode symbology from the Format dropdown — Code 128, EAN-13, EAN-8, UPC, or Code 39.
- Type the value into the Value box. Each format has rules: EAN-13 needs 12–13 digits, UPC needs 11–12 digits, Code 39 accepts A–Z, 0–9 and a few symbols, and Code 128 accepts any printable ASCII.
- Watch the live preview render below. If you enter invalid data for the chosen format, an error message tells you exactly what is wrong instead of drawing a broken barcode.
- For EAN and UPC, you can omit the final check digit — the generator calculates and appends it for you automatically.
- Click Download SVG to save a vector file that prints sharply at any size, from a 2 cm label to a full sheet.
A practical guide to 1D barcodes
A linear (1D) barcode encodes a number or short string as a pattern of parallel bars and spaces of varying width. A scanner sweeps a beam across the symbol, measures the relative widths, and reconstructs the digits. The set of rules that maps characters to bar patterns is called a symbology. Different industries standardised on different symbologies, which is why this tool offers five of them — picking the right one matters more than it might seem.
Code 128 — the flexible workhorse
Code 128 encodes the full 128-character ASCII set and packs it densely, which is why it dominates shipping labels, logistics, and internal asset tracking. It has three sub-modes (A, B, C); mode C compresses pairs of digits into a single symbol, so a long numeric string takes very little width. If you are labelling boxes, shelves, or equipment with an alphanumeric code like SNAPTOOLS-2026, Code 128 is almost always the right answer.
EAN-13 and UPC — retail product codes
These are the GS1 retail symbologies you see on grocery items. EAN-13 carries 13 digits and is the worldwide standard; UPC-A carries 12 digits and is used in the US and Canada. Both end with a check digit computed from the preceding digits — a weighted modulo-10 calculation that lets a scanner detect a misread. EAN-8 is a compact 8-digit variant for tiny packages such as cosmetics or confectionery where a full EAN-13 simply will not fit.
Code 39 — legacy and industrial
Code 39 (also called Code 3 of 9) is one of the oldest alphanumeric symbologies. It encodes uppercase A–Z, digits 0–9, and a handful of symbols, and it frames each symbol with an asterisk start/stop character. It is less dense than Code 128 but remains mandated in some automotive, defence, and healthcare systems, so you will still meet it on older labels.
Print size and the quiet zone
Because the download is SVG, the barcode stays crisp at any size — but two rules keep it scannable. First, do not shrink the bars below the printer's reliable resolution; thin bars that blur together cause misreads. Second, leave a quiet zone: a clear margin of at least ten times the narrowest bar width on the left and right. Without it, scanners struggle to find where the symbol begins and ends.
When a 2D code fits better
A 1D barcode is perfect for a short number a laser scanner reads at speed, but it tops out at a few dozen characters. When you need to carry a URL, a batch of metadata, or anything a phone camera should act on, reach for a matrix code instead.
- • QR code generator — a 2D matrix that holds product pages, manuals, or thousands of characters.
- • QR code decoder — note that this reads QR codes, not 1D barcodes, which use a different scanner.
- • vCard QR code generator — encode supplier or contact details next to a product label as a 2D code.
Frequently asked questions
Which barcode format should I use?
What is the difference between EAN-13 and UPC?
Do I need to include the check digit?
Why does my value show an error?
Can I print these barcodes for product labels?
Are these the same as QR codes?
Is my barcode data sent to a server?
Will a retailer accept a barcode I generated here?
Related tools
More tools you might find useful in the same flow.
QR Code Generator
QR code generator — create QR codes for URLs, text, email, and phone numbers, then download as PNG or SVG. Free, with codes generated in your browser.
WiFi QR Code
WiFi QR code generator — create a code guests scan to join your WiFi network instantly, no typing passwords. Free, and credentials stay on your device.
vCard QR Code
vCard QR code generator — create a QR code that saves your name, phone, and email straight to a contact list when scanned. Free, made in your browser.
SMS QR Code
SMS QR code generator — create a QR code that opens a pre-filled text message to your number when scanned. Free, instant, and generated in your browser.
Built by Muhammad Tahir · About