Barcode Generator
Generate a Code 128 barcode from any text instantly in your browser — a scalable SVG, ready for labels and product tags.
Code 128 barcodes stay reliably scannable up to 80 characters.
What Is a Barcode Generator?
A barcode encodes text — a product SKU, a serial number, a tracking code — as a pattern of parallel black bars and white spaces that a scanner can read back instantly, without anyone typing the value in by hand. This tool generates Code 128, one of the most widely used barcode formats: compact, able to encode any letter, digit, or common punctuation mark, and readable by essentially every barcode scanner in use today.
Why Code 128?
- It encodes the full range of printable ASCII characters — letters, digits, spaces, and punctuation — not just digits like some older formats (UPC, EAN).
- It's compact: Code 128 packs more information into less horizontal space than most alternatives, which matters on small labels.
- A built-in checksum means a scanner can detect a misread rather than silently returning the wrong value.
- It's an open, widely supported standard — used in shipping labels, retail, and inventory systems worldwide.
How This Tool Works
Type the text you want to encode and click Generate. The barcode is built entirely in your browser as a scalable SVG image, with the original text printed underneath for a human to read alongside the scan. Nothing is uploaded — your data never leaves your device.
Code 128 vs QR Code — When to Use Each
Both encode text into a scannable image — the difference is mostly about how much data you need to fit and what's scanning it.
| Feature | Code 128 (barcode) | QR Code |
|---|---|---|
| Shape | 1D — a single row of bars | 2D — a square grid |
| Character support | Full printable ASCII | Full printable ASCII, and higher capacity |
| Data capacity | Good for short codes (SKUs, IDs) | Good for longer content (URLs, contact info) |
| Scanner requirements | Any laser or camera barcode scanner | Camera-based scanner (most smartphones) |
| Common uses | Retail, shipping, inventory | Marketing, URLs, payments, contact sharing |
Use a Barcode (Code 128) When
- You're labeling inventory, shipping packages, or retail products — the systems already reading barcodes expect this format
- The content is short — a SKU, serial number, or ID — and doesn't need a smartphone camera to scan
- You need compatibility with existing laser barcode scanners, not just camera-based ones
Use a QR Code When
- You're encoding a URL, Wi-Fi credentials, or contact information — anything longer than a short code
- The primary audience is scanning with a smartphone camera, not a dedicated scanner
- See our QR Code Generator if that's what you need instead
Common Scenarios for Generating a Barcode
Labeling Inventory or Products
Small businesses and warehouses often need barcodes for items that don't come with one — internal SKUs, custom product lines, or asset tags. Generating a Code 128 barcode from your own ID scheme lets you print labels compatible with any standard barcode scanner.
Printing Shipping or Asset Tags
If you're preparing a batch of labels to print, generating each barcode as an image and combining them onto a single sheet is a common workflow — our Image to PDF Converter can combine several barcode images into one printable PDF once you've generated them.
Encoding a Serial Number or Reference Code
Tracking codes, order numbers, and reference IDs are natural fits for Code 128 — it handles letters, digits, and punctuation without needing a numeric-only format.
Testing a Barcode Scanning Workflow
If you're building or testing software that reads barcodes — a point-of-sale system, an inventory app — generating known test barcodes on demand is faster than hunting down physical products with the right codes already printed on them.
Adding a Scannable Code to Documentation or Packaging
A barcode embedded in a manual, spec sheet, or packaging design gives a scanner-equipped reader instant access to a reference number or lookup code without them needing to type anything.
Other Ways to Generate a Barcode
You can also generate a Code 128 barcode using a desktop label-printing app, or a short script using a barcode library in your language of choice. FileCast is useful for a quick, one-off barcode without installing anything.
Frequently Asked Questions
Is it safe to generate barcodes here?
Yes. This tool runs entirely in your browser. The text you enter is processed on your own device — nothing is uploaded to a server.
What barcode format does this generate?
Code 128, specifically subset B — it covers every printable ASCII character (letters, digits, spaces, and common punctuation). It's one of the most widely supported 1D barcode formats and is readable by essentially any barcode scanner.
What characters can I encode?
Any printable ASCII character: letters (upper and lower case), digits, spaces, and standard punctuation. Characters outside that range (accented letters, emoji, most non-Latin scripts) aren't supported by Code 128 and will show a clear error.
Is there a length limit?
Yes, up to 80 characters. Code 128 can technically encode longer strings, but very long barcodes become impractical to scan reliably at normal print sizes — if you need to encode more, a QR code (see our QR Code Generator) handles longer content better.
What file format does the barcode download as?
An SVG (scalable vector graphic). Unlike a PNG or JPG, an SVG barcode can be resized to any dimension — for a small label or a large sign — without losing sharpness or becoming blurry.