codigo-qr.es

§BARCODE / CODE128

Free Code 128 barcode generator

Code 128 is the universal alphanumeric barcode: letters, numbers and symbols in a single barcode. Ideal for internal inventory, labels, serial numbers and industrial stickers.

  • CODE128 standard
  • Live preview
  • Scans on any reader

Letters and numbers, between 1 and 80 characters.

§WHAT IS

What is Code 128 and why is it called that?

Code 128 is a high-density alphanumeric barcode format published in 1981 by Computer Identics. It can encode the 128 printable ASCII characters in a single scannable barcode.

Code 128 was designed in response to the limitations of Code 39, which only supports uppercase and digits. Code 128 encodes the 128 standard ASCII characters, hence its name: uppercase, lowercase, numbers, punctuation marks and control characters. This makes it the most versatile format among 1D barcodes. The key to Code 128 lies in its three subsets (A, B and C) that the reader switches between automatically to reduce code width: subset C encodes pairs of digits in a single bar, halving the width when data is numeric. Subset B is used for mixed text, and A for control characters. Code 128 also includes a check digit based on modulo 103, calculated automatically by any serious generator. This makes it reliable: approximately 99.9% probability of detecting incorrect readings if a bar is partially damaged. It is not tolerant like QR (does not recover lost data), but it does detect and reject errors.

§WHEN TO USE

When should you choose Code 128 over the alternatives?

When you won't sell the product through organized retail. Code 128 is perfect for internal inventory, shipping labels, serial numbers, asset identifiers and any code you generate and read within your own operation.

Code 128 is the typical choice when you don't need a GS1-assigned code. Common cases: - Internal warehouse inventory: parts, materials, tools, production batches. - Shipping labels with proprietary tracking numbers. - Asset identifiers (computers, printers, office furniture). - Stickers on physical files in law offices, accounting firms or medical practices. - Wristbands at events where each attendee has a unique identifier. - Internal coupons with expiration date and alphanumeric code. Don't use it for organized retail (POS systems can scan it but won't accept it in chain TPV systems), for pallet logistics (better ITF-14) or when you need structured data such as batch and expiration (better GS1-128). Versus Code 39, Code 128 offers much higher density (40-50% less width for the same data), supports lowercase and special characters, and has better error detection. Code 39 is only preferable if your legacy system requires it for compatibility.

§SPECS

Code 128 technical specifications

Length

1-80

Characters

Alphanumeric

Example

ABC-1234-XYZ

Check digit

No

Code 128 is standardized by ISO/IEC 15417. Specifications: - Length: 1 to 80 characters (in practice beyond 30-40 characters the code becomes very long and hard to read). - Character set: 128 printable ASCII characters (codes 0 to 127). - Check digit: modulo 103, calculated automatically. - Subsets: A (control characters), B (uppercase and lowercase alphanumeric), C (digit pairs). - Dimensions: recommended X factor between 0.191 mm and 1.016 mm. Quiet zone of 10X on each side. - Density: 5.5 mm/character in numeric subset C, 11 mm/character in alphanumeric subset B. - Resilience: checksum detection, no recovery. Bar damage causes read rejection.

§COMPARISON

How does Code 128 compare to QR and Code 39?

Code 128 is linear with a check digit and supports full ASCII. QR is 2D and supports up to 4,296 characters with error recovery. Code 39 is linear but only uppercase and digits, less dense.

QR vs Code 128 is a frequent comparison. QR wins on capacity (thousands of characters versus dozens), tolerates partial damage (up to 30% with H level) and allows visual personalization with center logos. Code 128 wins on compatibility: any laser scanner from the 90s reads Code 128, while QR requires a camera and software. Code 39 was the standard alphanumeric barcode before Code 128. It is still used in aviation, automotive and industrial machinery by inertia and compatibility with old systems. If you start a new project, there is no reason to prefer Code 39 over Code 128: the latter is denser, supports more characters and has better error detection. When choosing between Code 128 and QR for a new label: if you only need to pass between 5 and 30 characters to a laser reader, Code 128. If you'll deliver more than 50 characters, a URL, contact data, or want the customer to scan with their phone, QR.

§FAQ

Frequently asked questions about CODE128

  • Q.01

    Is Code 128 free for commercial use?

    Yes. Code 128 has been free of patents and royalties since its publication. Anyone can generate and print Code 128 codes on commercial products without paying licensing, unlike the EAN-13 standard which requires GS1 registration.

  • Q.02

    What maximum length does this generator recommend?

    Technically up to 80 characters. In practice, keep content below 30-40 characters if you'll print it on a standard label: beyond that the code becomes very wide and requires high-resolution printing to remain readable.

  • Q.03

    Does Code 128 work with any reader?

    Yes. Any laser scanner from the past 25 years decodes Code 128 by default. It is one of the most universal formats alongside EAN-13 and UPC-A. Professional mobile scanning apps like Scandit, Cognex, Zebra DataWedge also support it without configuration.

  • Q.04

    Can I combine Code 128 with human-readable text?

    Yes, the generated code includes the text below the bars (the labeled text you see). It allows a human to interpret the content if optical reading fails. If you want to hide the text, you can edit the downloaded SVG to remove that element.

  • Q.05

    What should I do if my Code 128 doesn't scan?

    Three usual causes: insufficient white margin (you need at least 10X of quiet zone on each side), low-resolution printing that blurs thin bars (print at 300 dpi minimum), or scale too small. Download the SVG and try printing at 1.5x size if your reader fails.

Ready to create your CODE128 code

Generate it above, set the value and download in PNG or SVG. No sign up, no watermark.

Go to generator