Code 128 Barcode Generator

Create Code 128 barcodes for shipping, logistics, and alphanumeric data.

Alphanumeric (letters, numbers, symbols)

Need a different barcode type? Browse all generators

What is a Code 128 Barcode?

Code 128 is a high-density linear barcode that can encode all 128 ASCII characters, making it highly versatile for alphanumeric data. It's widely used in shipping, logistics, and supply chain management due to its ability to encode letters, numbers, and special characters in a compact format.

Code 128 uses three interchangeable character subsets (A, B, and C) to achieve the densest possible encoding for any given input string. It automatically switches subsets mid-barcode when doing so reduces the symbol's width. This makes Code 128 one of the most space-efficient linear barcode formats available, which is why it has become the default choice for shipping carriers like USPS, FedEx, and UPS.

Want to learn more about Code 128 barcodes? Read our complete guide to Code 128 for logistics applications, technical specifications, and implementation strategies.

How to Use This Generator

Creating a Code 128 barcode is easy:

  1. Enter any alphanumeric text (letters, numbers, and special characters)
  2. Click 'Generate Barcode' to create your Code 128 barcode
  3. Adjust bar height and text display in advanced options (optional)
  4. Download your barcode as SVG, PNG (multiple resolutions), or PDF

Technical Specifications

Key technical details for Code 128:

Data CapacityVariable length — no fixed limit (practical limit ~80 characters)
Character SetAll 128 ASCII characters (digits, uppercase/lowercase letters, symbols, and control codes)
Symbol SizeVariable width; each character is 11 modules wide (quiet zones: 10 modules each side)
Check DigitModulo 103 weighted checksum (calculated automatically)
Error CorrectionSingle check digit — no built-in error correction beyond the checksum
StandardISO/IEC 15417

Common Use Cases

Code 128 barcodes are ideal for:

  • Shipping labels and package tracking (USPS, FedEx, UPS)
  • Warehouse management and inventory control systems
  • Serial numbers, order numbers, and batch tracking
  • Healthcare and laboratory specimen labeling with alphanumeric identifiers
  • Government and military asset tracking systems

Tips & Best Practices

Get the most out of your Code 128 barcodes:

  • Let the encoder choose the optimal subset automatically — manually selecting A, B, or C can produce larger barcodes than necessary.
  • Use Code 128C (numeric pairs mode) when encoding long strings of digits, such as tracking numbers or account IDs, to reduce barcode width by up to 50%.
  • Maintain a minimum bar height of 15% of the barcode width (or at least 5 mm) to ensure reliable scanning with handheld readers.
  • Always include quiet zones of at least 10 module widths on each side of the barcode — printing too close to edges or other graphics causes scan failures.

Test Your Barcode

After generating your Code 128 barcode, verify it scans correctly with your barcode scanners before printing on shipping labels. Use our free barcode scanner to test your codes instantly - simply scan with your camera or upload an image to ensure proper encoding and readability. Test your barcode with our free scanner.

Frequently Asked Questions

Is this Code 128 generator free?

Yes, this Code 128 barcode generator is completely free with no limits, no registration, and no watermarks. You can generate as many Code 128 barcodes as you need and download them as SVG, PNG, or PDF files. All barcode generation happens locally in your browser, so your data stays private.

Can I create Code 128 barcodes in Excel?

While Excel doesn't natively generate Code 128 barcodes, you can use our free online generator to create them and download as SVG or PNG images, then insert them into your Excel spreadsheets. This approach avoids the need to install barcode fonts or third-party Excel plugins, and ensures every barcode is properly encoded with a valid check digit.

What is the difference between Code 128A, 128B, and 128C?

Code 128 has three character subsets. Code 128A encodes uppercase letters, numbers, and control characters. Code 128B encodes uppercase and lowercase letters, numbers, and common symbols. Code 128C encodes numeric-only data in pairs, producing the most compact barcode for all-digit strings. Most modern scanners and generators switch between subsets automatically for optimal density.

Is Code 128 royalty free?

Yes, Code 128 is a public-domain barcode symbology. There are no licensing fees, royalties, or patents restricting its use. Anyone can generate, print, and scan Code 128 barcodes for free in any commercial or personal project. The standard is defined by ISO/IEC 15417 and is open for unrestricted use.

What is the maximum data length for Code 128?

Code 128 is a variable-length symbology with no fixed upper limit defined in the standard. In practice, most scanners reliably read barcodes up to about 80 characters. Longer data produces a physically wider barcode that may become difficult to print and scan. For very large data sets, consider a 2D format like Data Matrix or QR Code instead.

Can I download Code 128 barcodes as SVG or vector format?

Yes, this generator lets you download Code 128 barcodes as SVG (scalable vector graphics), which can be resized to any dimension without losing sharpness. SVG files are ideal for professional printing, packaging design, and shipping labels. You can also export as high-resolution PNG or PDF depending on your needs.

Related Barcode Formats