How to Create a Barcode in Excel: 3 Methods That Work
Generate barcodes in Excel using barcode fonts, add-ins, or online generators. Step-by-step instructions for creating scannable Code 128, Code 39, and UPC barcodes from spreadsheet data.
Excel doesn't have a built-in barcode feature, but you can add scannable barcodes to any spreadsheet with three different approaches. A barcode font turns text into scannable bars right in the cell. An online generator creates barcode images you paste in. And add-ins bridge the gap with automated generation.
Each method has trade-offs. Here's when to use which, and exactly how to set each one up.
Quick Comparison
| Method | Best For | Formats Supported | Cost | Skill Level |
|---|---|---|---|---|
| Barcode font | Code 39 barcodes, quick setup | Code 39, Code 128 (with encoding) | Free | Easy |
| Online generator + images | Any format, small batches | All formats | Free | Easy |
| Excel add-in | Large batches, automated updates | Varies by add-in | Free to $100+ | Medium |
Method 1: Barcode Fonts
This is the fastest way to get barcodes into Excel. You install a font on your computer, type your data with special start/stop characters, and the font renders it as a barcode.
Why Code 39 Is the Easiest Font to Use
Code 39 has a huge advantage for font-based barcodes: the text you type is exactly what the barcode encodes. No complicated encoding tables, no check digit math. Just wrap your data in asterisks and apply the font.
Code 128 fonts exist, but the data needs to be encoded before display. That means formulas or macros to convert your plain text into the correct Code 128 character set. It works, but it's more effort.
Step 1: Download and Install a Barcode Font
Several free Code 39 fonts are available:
- Free 3 of 9 — the most widely used free Code 39 font. Search for "free 3 of 9 font download" and install the TTF file
- Libre Barcode 39 — available from Google Fonts. Download from fonts.google.com and install
- Libre Barcode 39 Text — same barcode but includes human-readable text below the bars
To install on Windows:
- Download the .ttf font file
- Right-click the file and select Install or Install for all users
To install on Mac:
- Download the .ttf font file
- Double-click it
- Click Install Font in the Font Book preview
After installing, restart Excel so it picks up the new font.
Step 2: Prepare Your Data
Code 39 supports: uppercase letters A-Z, digits 0-9, and these symbols: space, -, ., $, /, +, %
Your data needs asterisks as start and stop characters. If your product code is SKU1234, the cell needs to contain *SKU1234*.
Set up your spreadsheet like this:
| Column A: Data | Column B: Barcode Text |
|---|---|
| SKU1234 | SKU1234 |
| SKU1235 | SKU1235 |
| SKU1236 | SKU1236 |
In cell B1, enter this formula:
="*"&A1&"*"
Copy it down column B for all your rows.
Step 3: Apply the Barcode Font
- Select all cells in column B (the ones with asterisks)
- Change the font to Free 3 of 9 (or whichever barcode font you installed)
- Set the font size to 28pt or larger — smaller sizes won't scan reliably
- Set the cell text color to black and background to white
The cells now display as scannable Code 39 barcodes. Each one encodes exactly the text you see in column A.
Step 4: Adjust Column Width and Row Height
The barcodes need room. Widen column B until the full barcode displays without clipping. Increase the row height to match — about 50-60 points works for 28pt font. If bars look cut off at the top or bottom, increase row height further.
Step 5: Print and Test
Print the sheet (or just a few rows) on paper and scan the barcodes with a barcode scanner or phone scanner. Confirm the decoded text matches your column A data (without the asterisks — Code 39 scanners strip the start/stop characters).
If barcodes won't scan:
- Increase font size to 36pt or 48pt
- Make sure you're printing at 100% scale (no "Fit to Page")
- Check that the font rendered correctly — if you see asterisks and text instead of bars, the font isn't installed properly
- Print at High Quality, not Draft
Limitations of the Font Method
- Only Code 39 is simple. Code 128 fonts require encoding. UPC and EAN fonts are impractical because of check digit requirements.
- Not all characters work. Code 39 is uppercase only. No lowercase letters.
- Large barcodes. Code 39 barcodes are physically wider than Code 128 for the same data. Long data strings produce very wide barcodes.
- Not linked to updates. If you change the data in column A, column B updates automatically (if using formulas), but the barcode image in print may need re-verification.
Method 2: Online Generator + Inserted Images
This method works for any barcode format and doesn't require font installation. You generate barcodes from an online tool and insert the images into your spreadsheet.
Step 1: Generate Barcode Images
- Open our barcode generator
- Select your format (Code 128, UPC-A, EAN-13, QR Code, whatever you need)
- Enter the data from your first row
- Download as PNG
- Repeat for each barcode
For many barcodes, this gets tedious. See our bulk barcode generator guide for batch generation methods that produce all your images at once from a CSV.
Step 2: Insert Images into Excel
- Click the cell where you want the barcode
- Go to Insert > Pictures > This Device
- Select the barcode PNG
- Resize the image to fit the cell
Tip: To anchor the image to a cell so it moves and resizes with the cell:
- Right-click the image
- Select Size & Properties (or Format Picture)
- Under Properties, select Move and size with cells
Step 3: Organize Your Spreadsheet
| Column A: Data | Column B: Description | Column C: Barcode Image |
|---|---|---|
| 036000291452 | UPC Widget | (barcode image) |
| 036000291469 | UPC Gadget | (barcode image) |
Pros and Cons
Pros: Works with every barcode format. Images look exactly like the final printed barcode. Easy to verify visually.
Cons: Tedious for large numbers. Images don't update automatically if data changes. File size grows with many images.
Method 3: Excel Add-Ins
Add-ins automate barcode generation inside Excel. You enter data in a cell, and the add-in generates a barcode image or formatted output in another cell.
Free and Paid Options
| Add-In | Price | Formats | How It Works |
|---|---|---|---|
| TBarCode Office | ~$100 | All major formats | Inserts barcode objects linked to cells |
| StrokeScribe | Free (basic) | Code 128, QR, others | ActiveX control for Excel |
| Barcode Add-In for Excel (various) | Free-$50 | Varies | Macro-based generation |
General Setup (Most Add-Ins)
- Download and install the add-in
- Open Excel and enable the add-in in File > Options > Add-ins
- Select a cell containing your barcode data
- Use the add-in's toolbar or menu to generate a barcode from the selected cell
- The barcode appears as an object or image in an adjacent cell
The exact steps depend on which add-in you choose. Each comes with its own documentation.
When Add-Ins Make Sense
Add-ins are worth the setup when you need barcodes that update automatically as data changes, or when you're creating barcode-heavy spreadsheets that other people in your organization will use. For one-time projects, the font or image method is simpler.
Code 128 Barcodes in Excel (Advanced)
If you need Code 128 instead of Code 39, the font method requires extra work because Code 128 uses a non-trivial encoding scheme.
Why Code 128 Is Different
Code 128 has three character subsets (A, B, and C) and requires a start character, a checksum character, and a stop character that are computed from the data. You can't just type your data and apply a font.
Using Formulas for Code 128 Encoding
You need a VBA macro or a complex formula to convert your data to Code 128 encoding. Here's the simplified approach:
For numeric-only data (subset C): Code 128 Subset C encodes pairs of digits, which is efficient for long numbers. A VBA macro reads your data, calculates the checksum, and outputs the encoded string that the Code 128 font renders correctly.
This gets complicated fast. If you're going down this road, a dedicated tool or add-in is usually easier than building the encoding yourself.
The Practical Alternative
Instead of fighting with Code 128 encoding in Excel, consider this workflow:
- Keep your data in Excel as plain text
- Export the barcode data column as CSV
- Use a bulk barcode generator to create Code 128 images from the CSV
- Insert the images back into Excel, or print labels directly from label software
This separates the data management (Excel's strength) from barcode rendering (a barcode tool's strength).
Printing Barcodes from Excel
Page Setup Tips
- Set margins to narrow (0.5" or less) to maximize label space
- Set orientation to match your label sheet
- Go to File > Print > Page Setup and make sure scaling is set to 100% or No Scaling
- Print one sheet on plain paper first to check alignment
For Avery Label Sheets
Instead of fiddling with Excel cell alignment, consider using your Excel data with Avery's free Design & Print tool or Microsoft Word's mail merge with label templates. Both are designed for label printing and handle alignment automatically.
See our barcode label printing guide for full details on printing with label sheets and thermal printers.
Verify Before Bulk Printing
Always scan your printed test barcodes before committing to a large print run:
- Print 3-5 rows on paper
- Scan each barcode with our web scanner or a handheld scanner
- Confirm the decoded data matches your spreadsheet
- Check that barcodes scan from a normal reading distance (4-8 inches)
Related Guides
- Free Barcode Generator — generate barcodes in any format online
- Bulk Barcode Generator Guide — create hundreds of barcodes from CSV data
- How to Print Barcode Labels — print labels on office or thermal printers
- Code 128 Complete Guide — everything about the Code 128 barcode format
- Code 39 Complete Guide — everything about the Code 39 barcode format