Choose language

Code 128 Barcode Generator

Generate Code 128 barcodes from letters, digits, and symbols. Adjust scale and bar height, toggle human-readable text, and download as PNG or SVG.

Mehmet Demiray Published Updated
Share
Barcode GeneratorThe general barcode tool covering retail, logistics and general symbologies, with check digits added automatically and links to format-specific generators.
Code 128 encodes letters, digits and symbols.
Module width multiplier — larger values produce a wider barcode.
Height of the bars (in millimeters).
Print the encoded value as readable text under the barcode.

What Code 128 Is

Code 128 is a linear, or one-dimensional, barcode that encodes the full ASCII character set. That means it handles uppercase and lowercase letters, all ten digits, and a wide range of symbols in a single symbology. Defined in ISO/IEC 15,417, it is the highest density alphanumeric 1D barcode in common use, which lets it pack more characters into a narrow space than older formats. Each Code 128 barcode carries a mandatory modulo 103 check character that the scanner uses to confirm a clean read. This tool adds that check character for you, so you never calculate it by hand. The format pairs broad data support with reliable scanning, which is why it became the default choice for shipping, warehousing, and internal labeling across many industries. When you need to encode a serial number, an order reference, or a mixed string of letters and digits, Code 128 keeps the result compact and dependable.

Where Code 128 Shines

Code 128 is the workhorse of logistics and internal tracking. Carriers such as FedEx, UPS, and DHL print it on shipping labels because it stores long alphanumeric tracking numbers in a small footprint. Warehouses use it on bin labels, pallet tags, and pick lists, where staff scan it dozens of times a day and need a format that reads cleanly under wear and motion. Manufacturers tag assets and serial numbers with it so each unit stays traceable through production and service. Healthcare teams label specimens and samples with Code 128 because it encodes both the patient reference and the test code without splitting them across two symbols. Anywhere a string mixes letters, digits, and symbols and space is tight, this format fits. For a simpler industrial option with a fixed character set, compare it with the Code 39 Barcode Generator, and for a general starting point that covers several symbologies see the Barcode Generator.

Subsets A, B, and C

Code 128 reaches its density through three internal subsets. Subset A covers uppercase letters, digits, control characters, and standard symbols. Subset B covers uppercase and lowercase letters, digits, and symbols, which makes it the everyday choice for mixed text. Subset C is the clever one, because it encodes pairs of digits as a single symbol. That means a string of numbers takes roughly half the width it would in another subset, which is why purely numeric data scans from such a compact code. A Code 128 barcode can switch between subsets mid string, so a label that starts with letters and ends with a long number stays as short as possible. This tool selects the optimal subset automatically as it builds the pattern, so you simply type your data and get the most efficient encoding without choosing a mode yourself. Understanding the subsets helps explain why a numeric label often scans from a surprisingly small code while a long alphanumeric string needs more room on the page.

Print and Scan Guidance

A barcode only helps if scanners read it on the first pass, and print quality drives that. The X dimension is the width of the narrowest bar, and it sets the floor for how small the code can go. Keep it generous enough for your printer and your scanners, since a code crushed too small smears bars together. Give the symbol enough bar height so a scanner crossing it at a slight angle still catches a full bar pattern. Leave a clear quiet zone, a band of blank space on each side, so the scanner can locate the start and stop of the code. Maintain strong contrast with dark bars on a light background, and avoid printing over textures or photos. When you export, the SVG stays crisp at any size for sheet labels, while the PNG suits fixed screen previews. Print a test label and scan it at the real working distance before you commit to a full run.

Encoding Data Cleanly

Good barcode data starts before the print. Decide on a consistent length and structure for your codes so every label across a batch lines up, which makes downstream scanning and sorting predictable. Avoid stuffing more into a single code than you need, because each added character widens the bars and can push the symbol past the size your label allows. If you are encoding numeric identifiers, lean into the format's strength by keeping them numeric where you can, since digit pairs compress well. Decide whether to show the human-readable text below the bars, which helps a person read the value when a scanner is not at hand or a code is damaged. Validate your full data set on screen before printing, then scan a sample to confirm the value comes back exactly as typed. When you have many codes to make at once, a batch workflow saves the repeat effort of generating them one by one.

The ones we answer the most.

What is the difference between Code 128 and EAN-13?

EAN-13 is a fixed-length retail format that encodes exactly twelve digits plus a check digit, and it is meant for products sold at a register. Code 128 is far more flexible: it encodes the full ASCII set, including letters and symbols, and accepts variable-length data. EAN-13 suits store checkout, while Code 128 suits shipping, warehousing, and internal tracking where the data is alphanumeric and the length varies. They are built for different jobs rather than competing for the same one.

Can I encode letters and symbols?

Yes. Code 128 supports the complete ASCII character set, so you can encode uppercase and lowercase letters, digits, and a wide range of symbols in a single barcode. This is its main advantage over numeric-only formats. Type your full string into the tool and it builds the pattern, selecting the most efficient internal subset as it goes so the result stays as compact as the data allows.

How long can the data be in practice?

Code 128 has no strict character limit in the specification, but practical limits come from print size and scanner reach. Each character adds width, so a very long string produces a wide barcode that may not fit your label or may need a low-power scanner to pass slowly across it. For most uses, keeping the data to a couple of dozen characters keeps the symbol a comfortable size. If you need more, plan a larger label or split the data across fields.

What is GS1-128 and how does it relate?

GS1-128 is an application standard built on top of Code 128. It uses the same underlying symbology but adds GS1 Application Identifiers, which are standardized prefixes that label what each piece of data means, such as a batch number or an expiry date. So GS1-128 is Code 128 with an agreed data structure layered on top. If you only need to encode plain text or an internal reference, base Code 128 is what you want.

Do I need to calculate the check character?

No. Every Code 128 barcode includes a mandatory modulo 103 check character that scanners use to verify a clean read. The tool computes and adds it automatically as part of building the pattern, so you never work it out yourself. You enter only your actual data, and the check character is handled behind the scenes.

Should I show the text below the barcode?

It depends on your use. The human-readable text under the bars lets a person read or type the value when a scanner is unavailable or the code is damaged. For shipping and warehouse labels this is usually helpful, so most teams leave it on. If the code sits in a tight space or the value is shown elsewhere on the label, you can toggle the text off to save room. The tool gives you that choice.