How to create barcodes in Excel
- Put your codes in column A (format as Text if they are UPC/EAN numbers with leading zeros).
- In B2 enter
=IMAGE("https://barcodejar.com/api/barcode?type=code128&data="&ENCODEURL(A2)). - Fill the formula down and enlarge the rows so the barcodes are easy to scan.
- On older Excel, use a Code 39 font or paste the column into the bulk generator instead.
Quickest method (Excel 365): if your codes are in column A, type this in B2 and fill down:
=IMAGE("https://barcodejar.com/api/barcode?type=code128&data="&ENCODEURL(A2))
Each cell shows a Code 128 barcode drawn by our free barcode API. Change type= to upca, ean13, qrcode or any other type. Older Excel versions have no IMAGE function, so use Method 2 or 3.
Method 1: IMAGE() and the free barcode API (Excel 365)
The IMAGE function, available in Microsoft 365 versions of Excel, shows a picture from a web address inside a cell. Our barcode API returns a barcode image for any URL, so the two together make a barcode for every row with no add-ins.
| Barcode | Formula (value in A2) |
|---|---|
| Code 128 (SKUs, text) | =IMAGE("https://barcodejar.com/api/barcode?type=code128&data="&ENCODEURL(A2)) |
| UPC-A (11 or 12 digits) | =IMAGE("https://barcodejar.com/api/barcode?type=upca&data="&A2) |
| EAN-13 | =IMAGE("https://barcodejar.com/api/barcode?type=ean13&data="&A2) |
| QR code | =IMAGE("https://barcodejar.com/api/barcode?type=qrcode&data="&ENCODEURL(A2)) |
| No text under the bars | add &hrt=0 to the URL |
Tips for the IMAGE formula
- ENCODEURL makes spaces and symbols safe in the URL. Plain digits (UPC, EAN) do not need it. If your Excel version lacks ENCODEURL, use
SUBSTITUTE(A2," ","%20")for simple values. - UPC and EAN numbers: format the column as Text so Excel keeps leading zeros. The API adds the check digit to 11- or 12-digit input, and returns an error image if a full number has a wrong check digit.
- Bigger, sharper barcodes: make the row taller and the column wider, or add
&scale=4to the URL. - The cell value is sent to barcodejar.com to draw the image, so do not use it for confidential data.
Method 2: barcode font (any Excel version)
- Install the free Libre Barcode 39 font and restart Excel.
- In B2 type
="*"&UPPER(A2)&"*"and fill down. The asterisks are the Code 39 start and stop characters. - Set column B to Libre Barcode 39 at 24–36 pt.
This only works simply for Code 39. Code 128, UPC and EAN fonts need start, check and stop characters encoded by a macro, so typing the plain value gives bars that do not scan. See the barcode fonts guide.
Method 3: Excel column to barcode images (any version)
Copy the column (or save as CSV), paste it into the bulk barcode generator, pick the type, and download a ZIP of PNG/SVG images or a printable PDF. Use the label generator for Avery or thermal label sheets. The images are drawn in your browser, so nothing is uploaded.
See also: barcode generators for every platform, product and use case.
Frequently asked questions
Does Excel have a barcode function?
Not as such, but Excel 365's IMAGE function combined with our free barcode API works like one: =IMAGE("https://barcodejar.com/api/barcode?type=code128&data="&ENCODEURL(A2)).
Which Excel versions have the IMAGE function?
Microsoft 365 versions of Excel (Windows, Mac and the web). Excel 2021, 2019 and older do not have it, so use a barcode font or our bulk generator.
How do I make UPC barcodes from an Excel list?
Use =IMAGE("https://barcodejar.com/api/barcode?type=upca&data="&A2) with the column formatted as Text so leading zeros stay. Check digits are added to 11-digit input automatically.
Why will my Excel barcode font not scan?
Usually because the start/stop characters or check digit are missing. Code 39 needs * at both ends. Code 128 and UPC fonts need specially encoded text. The IMAGE method avoids this.
Can I print barcode labels from Excel?
Use Word mail merge with your spreadsheet (see barcodes in Word) or our label generator, which prints straight to Avery and thermal labels.
Is the barcode API free?
Yes, with no key or sign-up. See the barcode API page for all parameters, such as SVG output, scale, height and colours.