How to Create Barcodes in Excel (Fonts or Images)
There are two ways to put barcodes in Excel: install a barcode font and format cells with it, or generate barcode images from your column and place them in the sheet. Fonts are quickest for Code 39. Code 128 fonts need an extra encoding step, and images are more reliable for large lists or anything that must scan the first time.
Option 1: a barcode font
A barcode font is an ordinary font where each character draws a bar pattern. Install a font, type text in a cell, set the cell font, and the text turns into bars. Excel itself ships no barcode font, so you need to download one and install it on every computer that will view or print the file.
Code 39 is the easy one
Code 39 needs an asterisk at each end of the data. For a value in A2, put this in B2:
="*"&A2&"*"
Then set column B to your Code 39 font and make it large, typically 28 to 36 pt. The asterisks are the start and stop characters, and they will not print as text. Use only uppercase letters, digits, space and - . $ / + %.
Code 128 fonts need encoding
Code 128 is better, but a Code 128 font does not work with plain text. The barcode must contain a start character, the data, a check character and a stop character, and the check character is calculated from the data. Typing the raw value into a Code 128 font produces an unreadable barcode.
Font vendors solve this in one of three ways:
- an Excel add-in or macro that writes the encoded string for you,
- a worksheet formula that computes the check character (long, but it works),
- a separate encoder tool that you paste values into.
Whichever you use, the encoded cell is the one you format with the Code 128 font. Check the vendor's instructions for your font, because the character mapping is not standardized.
Option 2: images from a column
If the sheet has hundreds of items, fonts get fiddly. An alternative is to export the column as a CSV or paste it into a generator that returns one image per row.
- Copy the column of values from Excel.
- Paste them into the bulk barcode generator and pick a type, such as Code 128 or UPC.
- Download the images or a PDF.
- Insert the pictures into Excel or Word, or print directly from the PDF.
Images are not tied to an installed font, so the file looks the same on any computer. They also scale cleanly as SVG. Barcode Ready draws them in the browser, and the values you paste are not uploaded.
For a single code, the main barcode generator is enough.
Fonts versus images
| Font in Excel | Images from a generator | |
|---|---|---|
| Setup | Install font on every PC | None |
| Code 39 | Simple formula | Works |
| Code 128 | Needs encoding add-in or formula | Works |
| Data changes | Barcode updates automatically | Regenerate and replace |
| Reliability across computers | Falls back to text if font missing | Same everywhere |
Fonts win when the sheet is live and the barcode must change with the data. Images win for printing labels and sharing files.
Test before you print
- Print a sample at actual size and scan it with the real scanner.
- Keep a blank margin around the barcode.
- Do not shrink the font until the bars blur. If a code is too wide for the cell, widen the column instead.
- For product codes such as UPC or EAN, the numbers must be valid, including the check digit. Use the UPC generator to validate.
Summary
For Code 39, wrap the value in asterisks and use a Code 39 font. For Code 128, use an encoder rather than typing text into the font. For large lists or files you will send to other people, generate images from the column instead.