Code 128 font encoder
Typing plain text in a Code 128 font gives a barcode that won't scan. Paste your text here to get the font-ready version with the start, checksum and stop characters added, then use it in Excel, Word or any app.
Updated
Letters, digits, spaces and symbols. The start, checksum and stop characters are added for you.
Preview in Libre Barcode 128 Text. This is exactly what you'll see after applying the font.
Need the font? Free Code 128 fonts for Windows and Mac, licensed for commercial use:
Code 128 (.ttf)Code 128 with text (.ttf)All barcode fonts and install steps
How to use a Code 128 barcode font
- Download and install a Code 128 font. "Code 128 with text" prints the readable value under the bars.
- Type your value into the encoder above and click Copy.
- Paste the result into your document or spreadsheet.
- Select it and change the font to Libre Barcode 128 or Libre Barcode 128 Text.
- If the fonts do not appear or you are using the web version of excel, try entering the font's complete name and then pressing ENTER.
- Set the size to at least 36 pt, and leave some empty space on both sides of the barcode.
Code 128 font in Excel
To turn a whole column of values into barcodes, use the List for Excel mode:
- Select your values in Excel (for example A2:A200) and copy them.
- In the encoder, choose List for Excel and paste them into the left box.
- Click Copy all, click the first cell of an empty column (for example B2) and paste.
- Select that column and set the font to Libre Barcode 128 Text. Widen the column and increase the row height so each barcode fits.
The encoded values don't update by themselves. If a value in column A changes, encode it again. If your data changes often, use a formula instead: the Code 128 Excel formula encodes each value automatically in Excel 2013 or newer. The encoder still makes slightly shorter barcodes for long numbers.
Code 128 font in Word
Paste the encoded text, select it and apply the font. One thing to watch: Word's AutoCorrect can change characters as you type, for example turning straight quotes (" ') into curly ones. A single changed character breaks the barcode. Paste the encoded text rather than typing it, or turn off "Replace as you type" in Word's AutoCorrect options. For mail merge, encode your data list first and merge the encoded values.
Why plain text doesn't scan
A barcode font only draws bars for the characters it's given. A Code 128 barcode needs three things your text doesn't contain:
- A start character that tells the scanner where the barcode begins and which character set it uses.
- A checksum character calculated from all the other characters, so the scanner can detect a misread.
- A stop character that marks the end.
For example, BarcodeFont becomes ÌBarcodeFontQÎ. Ì is the start character, Q is the checksum and Î is the stop character. The checksum depends on every character, so it has to be calculated for each value. That's what the encoder does.
Why the encoded text looks strange
The extra characters like Ì, Î and Ç are how barcode fonts represent special Code 128 symbols. Two more things you may notice:
- Spaces become
Â. It draws the same bars as a space, but apps can't trim it or stretch it the way they do with spaces. - Numbers get shorter. For runs of digits, the encoder switches to a numeric mode that packs two digits into one symbol. That's why
123456encodes to just a few characters, and why Code 128 barcodes for numbers are so compact.
Code 128 font not scanning?
- The text wasn't encoded. Plain text in a Code 128 font never scans. Encode it first.
- The encoded text was edited. Changing any character invalidates the checksum. Edit the original value and encode again.
- Characters were changed automatically. AutoCorrect, smart quotes or a different font on part of the text can alter the encoded string.
- Wrong font. Code 39 fonts and Code 128 fonts are not interchangeable.
- Too small or no margin. Use at least 36 pt and leave white space on both sides.
- Unsupported characters. The encoder supports standard ASCII characters only, so accented letters and emoji can't be used.
Code 128 or Code 39?
Code 128 produces shorter barcodes and supports lowercase letters and all common symbols, but every value needs encoding. Code 39 is wider and supports fewer characters, but you only add an asterisk on each side, which is easy to do with a formula. For most inventory and shipping labels, Code 128 is the better choice. For quick spreadsheets that change often, Code 39 is simpler. Both fonts are on the barcode fonts page, and if you need a barcode image instead of a font, use the barcode generator.