How to Create Barcodes in Google Sheets™ (Code 128, Code 39, EAN-13, UPC-A)
Making something that looks like a barcode in Google Sheets™ is easy. Making one that a scanner reads first time is where most guides fall short. This guide covers three methods, the mistake that makes font barcodes unscannable, and a formula for EAN-13 and UPC-A check digits.
Short answer: Code 39 works with a free font if you wrap the value in asterisks. For Code 128, EAN-13 and UPC-A, use an image-based method: the IMAGE formula for a few barcodes or a bulk add-on for many.
Pick the right barcode type first
| Type | What it encodes | Typical use |
|---|---|---|
| Code 128 | Letters, digits, symbols | Shipping, warehouse labels, internal SKUs |
| Code 39 | A–Z (capitals), 0–9, space and - . $ / + % |
Asset tags, ID badges, older scanners |
| EAN-13 | Exactly 13 digits | Retail products sold outside North America |
| UPC-A | Exactly 12 digits | Retail products in the US and Canada |
For retail products you also need real GS1-issued numbers. A barcode generator draws the code; it does not register the number.
Method 1: barcode fonts (Code 39 only, really)
Google Sheets™ can use Google Fonts. Open the font menu ▸ More fonts, search for Libre Barcode 39 and add it.
The catch: a Code 39 barcode must start and end with an asterisk. Typing ABC123 in the barcode font produces stripes that no scanner will read. Use a helper column:
="*"&UPPER(A2)&"*"
Then set that column's font to Libre Barcode 39 and the size to 36 or larger.
Why fonts don't work for Code 128 or EAN-13: both formats need encoded start, stop and check characters, not just the plain digits. The Libre Barcode 128 and Libre Barcode EAN13 Text fonts exist, but typing your number in them produces a barcode that looks right and doesn't scan. You'd need a separate encoding formula for every row. Skip it and use an image method.
Method 2: the IMAGE formula (a few barcodes)
The IMAGE function can show a barcode image from a free service. For Code 128:
=IMAGE("https://quickchart.io/barcode?type=code128&text="&ENCODEURL(A2)&"&includetext=true")
Change type=code128 to code39, ean13 or upca for the other formats. Make the row taller so the bars aren't squashed.
The same limits apply as with QR formulas: the image is fetched every time the sheet recalculates, your values go to a third-party server in the URL, and if the service changes, your barcodes vanish.
Get EAN-13 and UPC-A check digits right
The last digit of an EAN-13 or UPC-A code is a check digit calculated from the others. Get it wrong and scanners reject the code, or worse, the formula service draws nothing.
Format the column as Format ▸ Number ▸ Plain text first, so leading zeros survive.
EAN-13 from 12 digits in A2:
=A2&MOD(10-MOD(SUMPRODUCT(MID(A2,SEQUENCE(12),1)*{1;3;1;3;1;3;1;3;1;3;1;3}),10),10)
Check: 400638133393 gives 4006381333931.
UPC-A from 11 digits in A2:
=A2&MOD(10-MOD(SUMPRODUCT(MID(A2,SEQUENCE(11),1)*{3;1;3;1;3;1;3;1;3;1;3}),10),10)
Check: 03600029145 gives 036000291452.
Method 3: a bulk barcode add-on (many barcodes, print-ready)
We built BarQR after doing the steps above by hand one too many times.
- Install BarQR: Bulk QR Code Barcode Generator for Sheets™ from the Google Workspace™ Marketplace.
- Go to Extensions ▸ BarQR: Bulk QR Code Barcode Generator for Sheets™ ▸ Open BarQR.
- Choose your source column, an output column and the type: Code 128, Code 39, EAN-13 or UPC-A.
- Pick a size. 600 px and up is print quality.
- Generate for all rows or just the ones you selected.
BarQR checks every value before drawing it. EAN-13 and UPC-A codes with the wrong length or a bad check digit, and characters Code 39 can't encode, are skipped and listed instead of being written as broken images. Enter 12 digits for EAN-13 or 11 for UPC-A and it calculates the check digit for you. Barcodes come with the human-readable digits underneath and a white margin (the "quiet zone") so scanners lock on quickly. The free plan covers your first 50 codes.
Printing barcode labels from Sheets™
- Leave white space around each barcode. Scanners need a quiet zone on both sides. Don't let borders or neighbouring cells touch the bars.
- Don't stretch the image. Squashing a barcode horizontally changes bar widths and breaks it.
- Print a test page at 100% scale and scan it before printing a full sheet of labels.
- Use File ▸ Download ▸ PDF and set scale to "Actual size" for label sheets.
FAQ
Can Google Sheets™ generate barcodes natively? No. You need a barcode font (works reliably only for Code 39), the IMAGE formula with a barcode service, or an add-on.
Why won't my barcode font scan? For Code 39, you're probably missing the asterisks at the start and end. For Code 128 or EAN-13, plain-text fonts can't produce a valid barcode without extra encoding. Use an image-based method.
Can I scan barcodes into Google Sheets™? Yes. Most USB and Bluetooth barcode scanners act like a keyboard: click a cell, scan, and the value is typed in.