Back to blog
Code 128 barcode guide

Code 128 Barcode: What It Is and How to Generate One Free

Code 128 is the most versatile barcode format in use today — on every Amazon shipping label, hospital wristband, and warehouse inventory tag. Here's what makes it different from EAN-13, how to pick the right sub-type, and how to generate one free.

Rabi Narayan PradhanProduct & Growth Research8 min read
Why readers save this article
Code 128 is on every Amazon shipping label, hospital wristband, and warehouse shelf tag — and most people have never heard its name
Code 128 can encode any of the 128 ASCII characters — letters, digits, and symbols — making it the most versatile common barcode format.
There are three Code 128 sub-types: A (uppercase + control chars), B (all printable ASCII, most common), and C (numeric pairs, very dense).
Code 128B is the right choice for almost every inventory, logistics, and healthcare label use case.
Unlike EAN-13 and UPC-A, Code 128 requires no GS1 registration — you can use any data you choose, including your own internal IDs.
Always download SVG for print labels — it scales to any size without blurring and is accepted by most professional label software.

Every Amazon package you've received has a Code 128 barcode on the shipping label. So does the wristband they gave you at the hospital, the shelf tag at your local warehouse store, and the inventory sticker on the back of every laptop in a corporate office.

Most people think of barcodes as those striped things on product packaging at the supermarket. Those are EAN-13 or UPC-A — a completely different format with strict rules about who can use them and what they can encode. Code 128 is different: it's the workhorse of internal logistics, more flexible than EAN-13, encodable for any text or number, and completely free to use without registration.

This guide explains what Code 128 is, how its three sub-types differ, how it compares to other formats, and how to generate one in under a minute.

What is a Code 128 barcode?

Code 128 was developed in 1981 by Computer Identics Corporation and published as a standard in 1987. The name comes from its ability to encode all 128 characters of the ASCII character set — the same character set used by computers to represent text. That's what makes it so flexible compared to older formats like Code 39, which only supports 43 characters.

Unlike EAN-13 and UPC-A (the barcodes used at retail checkouts), Code 128 has no fixed length. It can encode a 3-character internal code or a 40-character alphanumeric serial number — the barcode just gets wider. There's no registration required, no organization to apply to, and no fee. You define what data goes in it, and you generate it.

This combination of flexibility and zero registration overhead is why Code 128 became the dominant format for logistics, supply chain, healthcare, and internal inventory systems. It's everywhere — you just never knew what to call it.

Code 128A, 128B, and 128C — which one do you need?

Code 128 has three character set modes, each designed for a different type of data. Most barcode generators handle this automatically, but it's worth understanding the difference — especially if your software asks you to choose.

Code 128 three character set modes: Code 128A (uppercase + control characters), Code 128B (all printable ASCII, most common), Code 128C (digit pairs only, highest density)
Code 128B is the default for most use cases — it handles any combination of letters, numbers, and symbols.

How Code 128 compares to other barcode formats

Code 128 is not the only barcode format — it's just the most capable general-purpose one. Here's how it stacks up against the formats you're most likely to encounter.

Barcode format comparison table showing Code 128, EAN-13, Code 39, UPC-A, and ITF-14 compared by character encoding, limits, GS1 requirements, and use cases
If you need to encode letters and numbers together, Code 128 is almost always the right choice.
FormatEncodesCharacter limitGS1 requiredTypical use
Code 128Full ASCII (128 chars)NoNoLogistics, inventory, healthcare
EAN-13Digits 0–9 only12 digitsYesRetail products, supermarket
Code 39A–Z, 0–9, 9 symbolsNo limit (low density)NoGovernment, automotive, ID cards
UPC-ADigits 0–9 only11 digitsYesUS retail, Amazon, grocery
ITF-14Digits 0–9 only14 digitsNoOuter shipping cartons

Code 128 is the only common format with no character limit and no GS1 registration requirement.

When should you use Code 128?

Code 128 is the right choice whenever you need a barcode for internal use — not for products going to retail shelves (which require EAN-13 or UPC-A with GS1 registration). Specifically, it works well for:

Inventory management — label products, bins, or shelves with alphanumeric stock codes
Asset tracking — tag laptops, equipment, furniture, or tools with unique identifiers
Internal shipping labels — route packages within a warehouse or distribution centre
Healthcare — patient wristbands, medication labels, sample tube tracking
Employee ID cards and access control badges
Document management — tag folders or files with case or reference numbers
Library systems — encode book ISBNs plus additional metadata
Any system where the data includes both letters and numbers

How to generate a Code 128 barcode — step by step

  1. 1

    Decide what data to encode

    Write out the exact text string you want the barcode to contain. This could be a product SKU like "WH-2847-BLK", a serial number like "SN20260521-003", or any combination of letters, digits, and symbols up to whatever length your system uses. Code 128 has no character limit — keep the string as short as is practical to keep the barcode compact and reliable.

  2. 2

    Open a free barcode generator

    Go to a free barcode generator online. LinkLab's free barcode generator supports Code 128 alongside EAN-13, UPC-A, and ITF-14. No account is required for basic generation.

  3. 3

    Select Code 128 as the format

    From the format dropdown, choose "Code 128". If you see sub-type options (A, B, C), choose Code 128B unless your data is purely numeric and very long (in which case Code 128C is more compact). Most generators default to Code 128B automatically and handle the sub-type selection internally.

  4. 4

    Enter your data and preview

    Type or paste your data string into the input field. The barcode preview will update in real time. Check that the human-readable text below the barcode (if shown) matches your input exactly — this is the quickest way to spot a typo before generating the final file.

  5. 5

    Download as SVG or PNG

    Download SVG if the barcode will be printed — it's a vector format that stays sharp at any size, from a 1cm label to a full-page poster. Download PNG if you're embedding the barcode digitally (email, spreadsheet, web page). For physical labels, always use SVG.

Warning

Quiet zones and minimum bar width matter

1. Quiet zone — every Code 128 barcode needs a clear white margin (quiet zone) on both sides, at least 10 times the width of the narrowest bar. If you crop or place the barcode too close to other elements, scanners will fail to read it. Most label software handles this automatically, but check your final print layout. 2. Minimum size — the narrowest bar in a Code 128 barcode should be at least 0.19mm wide at print time. Below that, scanners struggle. At standard label sizes (50mm × 25mm or larger), you're well within this limit. For very small labels, test the scan before a print run.

Generate your Code 128 barcode free with LinkLab

Generate a Code 128 barcode — free, no sign-up

Enter any text or number, pick your format, and download PNG or SVG in seconds. Works for inventory labels, asset tags, and shipping barcodes.

Open the free barcode generator

Frequently asked questions

Start in under 60 seconds

Your URL shortener should do more than shorten
better links, QR codes, and analytics

Join teams using LinkLab to shorten URLs, create branded links, track campaign clicks, manage custom domains, and scale link workflows without switching platforms.

No credit card required
Free forever plan
5-minute setup