Make a Code 128 barcode

Letters, digits and punctuation in one compact barcode, with no check digit for you to work out.

Make a Code 128 barcode from any text or numbers, for labels, inventory and shipping. It is free, and what you type is not uploaded: everything runs in your browser on your device. The barcodes are drawn on this page, and after one visit and a short wait the page works offline.

Make a Code 128 barcodeor click to choose a file.

    Size, colours and options

    Type above and the barcode appears here.

    Working…

    Done

    Your files are processed on this device and never sent to a server. Reload the page to clear everything from memory.

    Code 128 holds letters, digits and punctuation in one compact barcode, which is why it is a common choice for inventory labels, shelf and bin tags, order numbers and shipping labels. It is the type to pick when no one has told you otherwise.

    It works by switching between three character sets. Set B holds capitals, lowercase letters, digits and punctuation, set A holds capitals, digits and control characters, and set C packs two digits into every bar character, so a long run of digits comes out much narrower. This page picks the sets for you and switches inside the barcode where that makes it shorter.

    The type also adds its own checksum character, and the scanner checks it and does not pass it on, so you have nothing to calculate and nothing extra appears in the scanned text.

    What Code 128 can hold here

    Code 128 and GS1-128

    How it works

    1. Type your text or number. Capitals, lowercase, digits, spaces and punctuation are all fine.
    2. Watch the width. A longer text makes a wider barcode; digits take half the room.
    3. Save a PNG, SVG or PDF and test-scan a printed copy.

    In your browser, not on a server

    JsBarcode (MIT), a small open-source library, turns your number or text into the pattern of bars in this page. The page first checks the number against the rules of the type you chose and works out the check digit itself. The PNG is painted on a canvas by your browser, the SVG is written as plain rectangles, and the PDF is made by pdf-lib (MIT) in the tab.

    Compared with upload-based tools: The number you type may be an unreleased product or an internal asset ID. Here the barcode is drawn on your device, so the number never leaves it.

    Verify it yourself. Give the page a short while after one visit to save itself for offline use, then turn off Wi-Fi or switch to airplane mode and run the tool again. Or open your browser's developer tools (F12, or Cmd-Option-I on a Mac), pick the Network tab, and watch it while you convert. The panel above does the same count for you.

    Questions

    Does a Code 128 barcode need a check digit?

    It has one built in, and the page adds it. Unlike UPC or EAN, you never type it, and it does not show in the printed text or the scanned result.

    Why is my barcode so wide?

    Every character takes the same room, so a long text makes a long barcode. Digits in a run are packed in pairs and take half as much room. Shorten the text, use a smaller bar width, or put the long part in a lookup instead of the barcode.

    Does case matter?

    Yes. Code 128 keeps capitals and lowercase letters as typed, so a scanner that reads order-a1 reports order-a1, not ORDER-A1. Code 39 is capitals only.

    Will my scanner read it?

    Code 128 is one of the most widely supported types, and most barcode scanners and scanner apps read it. A very old or specialised scanner may have it switched off, in which case its settings or manual list the types it reads.

    Is what I type uploaded anywhere?

    No. The barcode is drawn by code running in this page, so the number or text you type stays on your device. After your first visit and a short wait you can turn off your internet connection and it still works.

    More image tools

    Other conversions