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

MethodBest ForFormats SupportedCostSkill Level
Barcode fontCode 39 barcodes, quick setupCode 39, Code 128 (with encoding)FreeEasy
Online generator + imagesAny format, small batchesAll formatsFreeEasy
Excel add-inLarge batches, automated updatesVaries by add-inFree 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:

  1. Download the .ttf font file
  2. Right-click the file and select Install or Install for all users

To install on Mac:

  1. Download the .ttf font file
  2. Double-click it
  3. 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: DataColumn B: Barcode Text
SKU1234SKU1234
SKU1235SKU1235
SKU1236SKU1236

In cell B1, enter this formula:

="*"&A1&"*"

Copy it down column B for all your rows.

Step 3: Apply the Barcode Font

  1. Select all cells in column B (the ones with asterisks)
  2. Change the font to Free 3 of 9 (or whichever barcode font you installed)
  3. Set the font size to 28pt or larger — smaller sizes won't scan reliably
  4. 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

  1. Open our barcode generator
  2. Select your format (Code 128, UPC-A, EAN-13, QR Code, whatever you need)
  3. Enter the data from your first row
  4. Download as PNG
  5. 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

  1. Click the cell where you want the barcode
  2. Go to Insert > Pictures > This Device
  3. Select the barcode PNG
  4. Resize the image to fit the cell

Tip: To anchor the image to a cell so it moves and resizes with the cell:

  1. Right-click the image
  2. Select Size & Properties (or Format Picture)
  3. Under Properties, select Move and size with cells

Step 3: Organize Your Spreadsheet

Column A: DataColumn B: DescriptionColumn C: Barcode Image
036000291452UPC Widget(barcode image)
036000291469UPC 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-InPriceFormatsHow It Works
TBarCode Office~$100All major formatsInserts barcode objects linked to cells
StrokeScribeFree (basic)Code 128, QR, othersActiveX control for Excel
Barcode Add-In for Excel (various)Free-$50VariesMacro-based generation

General Setup (Most Add-Ins)

  1. Download and install the add-in
  2. Open Excel and enable the add-in in File > Options > Add-ins
  3. Select a cell containing your barcode data
  4. Use the add-in's toolbar or menu to generate a barcode from the selected cell
  5. 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:

  1. Keep your data in Excel as plain text
  2. Export the barcode data column as CSV
  3. Use a bulk barcode generator to create Code 128 images from the CSV
  4. 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:

  1. Print 3-5 rows on paper
  2. Scan each barcode with our web scanner or a handheld scanner
  3. Confirm the decoded data matches your spreadsheet
  4. Check that barcodes scan from a normal reading distance (4-8 inches)
9 min read

Frequently Asked Questions

Can I create a barcode in Excel without buying software?
Yes. You can use a free barcode font (like Code 39 fonts available online) installed on your computer, then apply that font to cells containing your data. The text displays as a scannable barcode. Alternatively, generate barcode images with a free online generator and paste them into your spreadsheet. Both methods cost nothing.
Which barcode font works with Excel?
Code 39 fonts are the easiest to use in Excel because Code 39 doesn't require check digit calculation — just add asterisks before and after your data (like *12345*) and apply the font. Free Code 39 fonts include 'Free 3 of 9' and 'Libre Barcode 39' from Google Fonts. Code 128 fonts exist too but require encoding the data first, which makes them more complex.
Do barcode fonts in Excel actually scan?
Yes, if printed correctly. The barcode font must be large enough (usually 28pt or larger for Code 39), printed in black on white at high quality, and the data must include required start/stop characters. Test by printing a sample and scanning with a barcode scanner app or web scanner before printing a full batch.
What is the best way to create barcodes from Excel data?
For small batches (under 50), generate barcodes from an online generator and insert images into Excel. For larger batches, use a barcode font applied directly to your data cells or use dedicated label software that imports your Excel data via CSV. The font method is fastest for Code 39; the online generator method works for any barcode format.
Can I create UPC or EAN barcodes in Excel?
Not directly with fonts alone, because UPC and EAN require specific encoding with check digit calculation. The easiest approach is to calculate the data and check digits in Excel using formulas, then generate the actual barcode images using an online generator like our free barcode generator. For bulk UPC/EAN generation, use a script or label software that reads your Excel data.