Free Code 128 Barcode Generator

🔒 Runs in your browser — nothing is sent to a server

Generate Code 128 barcodes online in seconds. Code 128 is the most widely deployed 1D barcode in logistics and inventory because it encodes the full 128-character ASCII set — letters, digits, and symbols — at variable length, and produces the most compact bars for any given payload. Paste your SKU, tracking number, or asset tag, adjust bar width, height, and quiet zone, and export a print-ready PNG or SVG. No registration required: Code 128 is a free, general-purpose format. Everything runs entirely in your browser — your data is never uploaded.

1. Select barcode type

2. Enter content and adjust style

Any text — e.g. Hello-123

Style

3px
100px
15px

3. Preview and download

No barcode yet — click Generate

Copied!
Copied!

Typical Code 128 use cases

Code 128 dominates any environment where you control both the label printer and the scanner: warehouse bin locations, pallet and carton labels, outbound shipping waybills (UPS, FedEx, and DHL all use Code 128 internally), IT asset tags, lab sample IDs, patient wristbands, conference badges, and event tickets. If the data is alphanumeric and will not pass through a retail till, Code 128 is almost always the correct format.

Print quality recommendations

For handheld laser scanners, a Code 128 barcode printed at 300 DPI with a 2-pixel X-dimension and a 10× quiet zone is reliable at a typical scanning distance of 10–30 cm. For thermal-transfer labels stored in harsh environments, bump the X-dimension to 3 px and verify scan rates on a representative sample before running a full print job. Always export as SVG and scale in your label template rather than resizing a PNG.

FAQ

What is Code 128?

Code 128 is a high-density, variable-length 1D barcode introduced in 1981 that can encode the full 128-character ASCII set. It uses three automatic subsets (A, B, C) to pack data efficiently: subset C is digit-only and encodes two digits per bar pair, roughly halving the width of numeric-only payloads. Today it is the default choice for shipping labels, warehouse inventory, and internal asset tagging.

What characters can Code 128 encode?

Code 128 encodes any ASCII character (0–127): uppercase and lowercase letters, digits, punctuation, and common control characters. There is no fixed length limit, though practical readability usually caps real-world Code 128 labels around 30–40 characters. This generator accepts any ASCII input and will not allow non-ASCII or emoji characters.

When should I use Code 128 over EAN-13 or UPC?

Use Code 128 whenever your data is not a retail product sold through a till. EAN-13 and UPC-A are locked to 12–13 digits and require GS1 registration. Code 128 has no registration requirement and accepts arbitrary text, so it is the right choice for internal SKUs, warehouse bins, shipping waybills, event tickets, lab samples, and asset tags — effectively everything outside retail checkout.

Does Code 128 need GS1 registration?

No. Code 128 is an open, royalty-free format that anyone can generate and print. The related format GS1-128 (formerly UCC/EAN-128) is a Code 128 with application identifiers that does require GS1 participation — but that is only needed when you are exchanging shipment data with a retailer or EDI partner. For internal use, plain Code 128 is free to use indefinitely.

What is the maximum length of a Code 128 barcode?

There is no hard specification limit — Code 128 can theoretically encode hundreds of characters. In practice, each character adds 11 modules of width, so a 40-character payload at 2-pixel bar width produces a barcode roughly 880 pixels wide. Most handheld scanners reliably read up to 40–50 characters; for longer data, switch to 2D formats like QR Code or Data Matrix.

Will my printed Code 128 barcode scan reliably?

Yes, provided you print at 300 DPI or higher, keep the bar width at 2 px minimum (3 px recommended for thermal printers), and preserve a quiet zone of at least 10× the bar width on each side. Code 128 has a built-in modulo-103 check character that the scanner validates automatically, so integrity is protected — but poor print quality or an undersized quiet zone will cause no-reads.

Glossary

Code 128

A variable-length 1D barcode symbology that encodes the full ASCII character set using three interchangeable subsets (A, B, C). Standardised as ISO/IEC 15417, it is the dominant format for logistics, shipping, and inventory worldwide thanks to its density and flexibility.

Subsets A / B / C

The three encoding modes inside Code 128. Subset A covers uppercase and control characters, subset B covers upper- and lowercase plus punctuation, and subset C packs pairs of digits into a single bar pattern for maximum density. Encoders switch subsets automatically to produce the shortest barcode possible.

Check character

A modulo-103 weighted sum calculated from every data character and appended before the stop pattern. Scanners recompute the check character on read and reject the scan if it does not match, protecting against misreads caused by smudges, print drift, or damage.

GS1-128

A constrained variant of Code 128 used in supply-chain EDI. GS1-128 uses the FNC1 start character and structured Application Identifiers (AIs) to encode standardised fields — lot number, expiry date, serial number — inside the same barcode. Not the same thing as plain Code 128, and requires GS1 membership.

Quiet zone

The mandatory clear margin on each side of the barcode with no printed content. Scanners use the quiet zone to delimit the barcode from surrounding artwork. For Code 128 the minimum quiet zone is 10× the narrowest bar width on both the left and the right.

Related tools