Practical Tools
Marketing

Code 128 Barcode Generator

Code 128 is the most versatile and widely used barcode format for internal and logistics applications. It encodes all 128 ASCII characters - uppercase and lowercase letters, digits, punctuation, and control characters - in a compact, high-density barcode. It is used for inventory labels, shipping labels, order IDs, serial numbers, and warehouse barcodes across every industry. This free Code 128 generator renders your value immediately and downloads as a high-resolution PNG or scalable SVG.

20 characters

Auto subset: B (printable ASCII)

About Code 128

Encodes all 128 ASCII characters. Auto-selects the most efficient subset (A, B, or C). Subset C is most compact for long digit-only strings such as serial numbers and order IDs.

How to use this tool

  1. 1Type or paste any text or number into the value field. Code 128 accepts letters (upper and lower), digits, spaces, and most punctuation.
  2. 2The auto-detected subset (A, B, or C) is shown below the input - subset C is automatically selected for long even-length digit strings as it halves the barcode width.
  3. 3The character count updates as you type - there is no hard limit, but keep labels practical (under 25 characters for standard label sizes).
  4. 4The barcode preview updates in real time.
  5. 5Click Download PNG for a raster image (2x scale for print quality) or Download SVG for a vector file.

Example

Inventory tracking label for a warehouse bin

Value: BIN-A04-R3-S12 (Aisle A, Row 4, Rack 3, Shelf 12). Code 128 encodes this mixed-character string in subset B. Download PNG and print on a 2x1 inch label for the shelf edge. The barcode scanner reads the location code instantly when the picker scans the bin.

Order ID barcode for a packing slip

Value: ORD-20240601-00847. Code 128 subset B handles the mixed letters, numbers, and hyphens. Download SVG and embed in the packing slip template. At the fulfillment center, scanning the barcode pulls up the order in the warehouse management system.

Common use cases

  • Printing inventory and stock labels for shelves, bins, and locations in a warehouse
  • Adding order ID or reference barcodes to packing slips, delivery notes, and returns forms
  • Creating serial number labels for manufactured goods, tools, and equipment
  • Labelling patient samples, records, and specimens in healthcare settings
  • Generating GS1-128 carrier codes for logistics and transportation documents

Common mistakes

  • Using Code 128 for retail product barcodes on consumer goods - retail point-of-sale scanners expect EAN-13 or UPC-A; Code 128 is for internal and logistics use.
  • Encoding very long strings that make the barcode too wide to fit on a small label - for numeric-only long codes (12+ digits), subset C compresses the barcode to half the width.
  • Printing at too small a width - a Code 128 barcode should be at least 15mm wide for reliable scanning with standard handheld scanners.

Frequently asked questions

What is Code 128?

Code 128 is a high-density linear barcode format that encodes all 128 ASCII characters. It is the most common format for internal inventory, shipping, and logistics barcodes because it handles both text and numbers efficiently. GS1-128 (used for supply chain Application Identifier labels) is a variant of Code 128.

What are Code 128 subsets A, B, and C?

Code 128 has three subsets. Subset A encodes uppercase letters, digits, and control characters. Subset B encodes the full printable ASCII set including lowercase letters. Subset C encodes digit pairs only and produces barcodes half the width of A or B - ideal for long numeric strings like serial numbers. Encoders (including this tool) auto-select the most efficient subset.

Code 128 vs Code 39 - which should I use?

Code 128 is the better choice for almost all new applications. It is denser (shorter barcode for the same data), supports the full ASCII set including lowercase, and is universally supported. Code 39 is simpler and found in older systems but only supports uppercase letters, digits, and a small set of symbols.

Is my data sent to a server?

No. All barcode generation runs in your browser. Your data is never sent to any server.

Related tools

Last updated