Free Barcode Generator (Code 128)
Type any text and get a scannable Code 128 barcode instantly — download as PNG or SVG.
How a 1D barcode differs from a QR code
Code 128 is a "linear" or "1D" barcode — every bit of information is encoded purely in the widths of a sequence of bars and spaces read along a single horizontal line, which is exactly why a scanner has to be roughly aligned with the barcode to read it. A QR code is "2D" — it encodes data in both dimensions of a grid, which packs in far more information per square inch and lets a scanner read it from any rotation or angle, at the cost of needing a camera-based scanner rather than a simple laser line reader. Code 128's tradeoff is speed and universal compatibility with decades of existing barcode-scanning hardware, which is exactly why it remains standard on shipping labels and inventory systems that already have that infrastructure in place.
What the checksum actually protects against
Code 128 includes a built-in checksum character, calculated from the encoded data, that lets a scanner detect if it misread the barcode — a smudged or misaligned scan that would otherwise silently return the wrong value instead gets flagged as invalid. That's a meaningfully different guarantee than QR's error correction: a checksum can tell you a read failed, but it can't reconstruct missing data the way QR's Reed-Solomon redundancy can when part of the code is physically damaged or obscured.
Frequently Asked Questions
What is Code 128?
A widely used, high-density barcode format that can encode the full ASCII character set — letters (upper and lower case), digits, and most symbols. It's common on shipping labels, inventory tags, and product packaging.
Will this barcode actually scan?
Yes — the barcode is generated with JsBarcode, a widely used open-source encoding library, rather than a custom implementation, so the bar widths follow the Code 128 specification exactly.
PNG or SVG — which should I use?
SVG scales to any size without blurring, which matters for barcodes since scanners are sensitive to bar-width distortion — ideal for professional printing. PNG is simpler to drop into documents or spreadsheets where exact scaling matters less.
Why did my barcode disappear or show an error?
Code 128 only supports standard ASCII text — if the input is empty or contains characters outside that range, generation is skipped until the text is valid.
What's the actual difference between a barcode like this and a QR code?
Code 128 is a 1D (linear) barcode — data lives entirely in bar widths read along one line, so it needs rough alignment with the scanner and holds comparatively little data. QR is 2D, encoding data across a full grid, which holds far more information and can be scanned from any angle — the tradeoff being it needs a camera-based scanner rather than a simple laser reader.
Does Code 128 have error correction like a QR code does?
Not in the same sense. Code 128 includes a checksum character that lets a scanner detect a misread, but it can't reconstruct missing data the way QR's error-correction redundancy can when part of the code is physically damaged.