Skip to content
100% local

Code 128 barcode generator

Turn text into a scannable Code 128 barcode, rendered as copyable SVG.

Input
60
2
10
Output

Code 128 barcode generator

Paste any text and this tool encodes it as a Code 128 barcode — the linear symbology used on shipping labels, inventory tags, retail price tickets and ID badges — and renders it as SVG you can copy straight into a document, label template or print layout. The checksum is calculated automatically, so the code you get is ready to scan.

Character set controls how each character is packed into the code. Automatic switches between set B (letters, digits and punctuation) and set C (pairs of digits, twice as dense) whenever a run of four or more digits shows up, which is how most real-world barcodes stay short. You can also force set A, B or C directly — set A adds control characters at the cost of lowercase letters, and set C only accepts an even number of digits. Bar height, the width of the narrowest module and the quiet zone (the blank margin a scanner needs on each side) are all adjustable, and you can toggle the human-readable text printed under the bars.

Turn on batch mode to generate one barcode per line of input — useful for a whole list of SKUs or serial numbers in one pass. Text longer than 2,000 characters per line is rejected with a clear message rather than producing a code too dense to scan reliably; characters outside the ASCII range (accented letters, emoji) aren't supported by Code 128 itself, so those are flagged too.

Everything runs locally in your browser — the text you enter, and the barcode generated from it, never leave your device. Copy the SVG markup, download it as a .txt file, or send the output back into the input to tweak it further.

FAQ

What is Code 128, and when should I use it over a QR code?
Code 128 is a compact linear (1D) barcode that packs any ASCII text — letters, digits and punctuation — into a dense line of bars, and it is what most shipping, inventory and retail scanners expect. Reach for a QR code instead when you need a link, contact card or other structured data a phone camera should scan.
How does automatic character-set switching work?
In automatic mode the tool uses character set C — which packs two digits into one symbol — for any run of four or more consecutive digits, and set B for everything else, switching back and forth as needed. This keeps the barcode as short as possible without you choosing a set by hand.
Why did my text get rejected in character set A or C?
Set A covers control characters and uppercase text but not lowercase letters; set C only encodes digits, two at a time, so it needs an even count. Switch to automatic mode, or to set B, and the same text will usually encode without issue.
Can I generate a whole list of barcodes at once?
Yes — turn on batch mode and put one value per line. The output contains one SVG barcode per non-empty line, in the same order as your input.
Is my text uploaded anywhere?
No. The barcode is calculated and drawn entirely in your browser — your text never leaves your device.