How to Create a Barcode in Google Sheets
Create scannable barcodes and QR codes in Google Sheets using free Libre Barcode fonts, the IMAGE formula, or add-ons, with steps for Code 39 and Code 128.
Google Sheets has no built-in barcode button, but it doesn't need one. Between the fonts already sitting in the Google Fonts library and the IMAGE formula's ability to pull in any image URL, you can get scannable barcodes into a spreadsheet in a few minutes, without installing anything beyond a font.
This guide covers both routes: the font method for quick, offline Code 39 barcodes, and the formula method for Code 128, EAN, UPC, and QR codes that fonts alone can't produce.
How Do I Create a Barcode in Google Sheets?
The two practical methods are a barcode font applied directly to a cell, or the IMAGE formula pointed at a barcode-generating API. Fonts are simpler and need no internet connection once installed, but only cover a few formats. Formulas cover far more formats and update live, but require the spreadsheet to fetch an external image each time it renders.
| Method | Best For | Formats | Setup |
|---|---|---|---|
| Libre Barcode font | Quick Code 39 barcodes | Code 39, Code 128, EAN13 (limited) | Add font via "More fonts" |
| IMAGE formula + API | Any format, live updates | Code 128, UPC, EAN, QR, more | One formula, no install |
| Marketplace add-on | Bulk generation, labels | Varies, often 50-100+ formats | Install from Workspace Marketplace |
Which one to use depends on volume and format. A handful of Code 39 barcodes is a font job. Anything involving UPC, EAN, or more than a few dozen rows is easier with a formula or a dedicated add-on.
Can I Use a Barcode Font in Google Sheets?
Yes. Google Sheets can add any family from the full Google Fonts library, and that library includes Libre Barcode 39, Libre Barcode 128, and Libre Barcode EAN13 as free, open-source options. No plugin or file upload is required because the fonts are already part of Google's own font catalog.
To install one, click the font name box in the toolbar, choose "More fonts," search "Libre Barcode," and add the variants you want. Libre Barcode 39 renders bars only; Libre Barcode 39 Text adds human-readable characters beneath the bars, which makes misreads easier to catch during printing.
Code 39 is the easiest format for this method because the visible text is exactly what gets encoded, once wrapped in start and stop asterisks. In an adjacent column, a formula like ="*"&A1&"*" prepares the data, and applying the Libre Barcode 39 font to that column turns the text into bars. Set the font size to at least 24-28pt so the bars stay wide enough to scan reliably after printing.
Code 128 and EAN13 fonts exist in the same Google Fonts family, but both formats require calculating a check digit or subset character before the raw text will render as a valid barcode, which plain text in a cell cannot do on its own. For those formats, the formula method below is more reliable.
Is There a Barcode Formula for Google Sheets?
Yes. The IMAGE function accepts any direct image URL, and several free services generate a barcode image on the fly from a URL you build with a formula. This approach handles formats the fonts can't, including Code 128, UPC-A, and EAN-13, and the barcode updates automatically whenever the source cell changes.
A working formula looks like:
=IMAGE("https://barcode.tec-it.com/barcode.ashx?data="&ENCODEURL(A1)&"&code=Code128")
ENCODEURL() keeps spaces and special characters from breaking the request, and code=Code128 tells the service which symbology to render; changing that parameter switches formats. TEC-IT's free tier is intended for non-commercial use and asks that a visible backlink to their generator accompany embedded barcodes, so check a service's terms before using it on a public or commercial document.
The main tradeoff versus fonts is that each barcode is a live image fetched over the internet rather than rendered locally, so the sheet needs a connection to display them and Google Sheets will prompt for permission to load external content the first time you use the formula.
How Do I Generate QR Codes in Google Sheets?
The same IMAGE-plus-API pattern works for QR codes. The goQR.me service exposes a free, no-key API for exactly this:
=IMAGE("https://api.qrserver.com/v1/create-qr-code/?size=200x200&data="&ENCODEURL(A1))
The size parameter sets the QR code's pixel dimensions, and data takes whatever text, URL, or Wi-Fi string you want encoded. Older tutorials often reference Google's own chart.googleapis.com Image Charts API for this same trick; that service has since been shut down and the URLs now return errors rather than images, so it's worth updating any spreadsheet still using it.
For a wider range of QR code content types, like contact cards or Wi-Fi credentials, see our guide to creating a QR code for Wi-Fi, which covers the exact string format each content type needs before you encode it.
Should I Use an Add-On Instead?
For bulk work, an add-on from the Google Workspace Marketplace is often faster than either method above, since it handles hundreds of rows, label layouts, and export formatting in one pass rather than one formula per barcode. Search "barcode generator" or "bulk barcode" in Extensions > Add-ons > Get add-ons, and check the format list before installing, since coverage varies from a handful of symbologies to more than a hundred, including GS1 formats.
Add-ons make the most sense when barcodes need to go straight to printable labels, or when the same sheet regenerates barcodes regularly as inventory changes. For a one-off batch, the formula method above usually gets there faster with no install step. For higher-volume, non-spreadsheet workflows, our bulk barcode generator guide covers CSV-based batch generation outside of Sheets entirely.
How Do I Test That My Barcodes Actually Scan?
Before relying on a sheet full of barcodes for labels or inventory, print or screenshot a small sample and scan it. Font-based barcodes fail most often from font size that's too small or printing at less than 100% scale; formula-based barcodes fail most often from a missing ENCODEURL() wrapper that lets special characters corrupt the request.
Scan a handful of test barcodes with a phone camera or a web-based barcode scanner and confirm the decoded value matches the original spreadsheet cell exactly, including any leading zeros that spreadsheet formatting sometimes strips. Catching a formatting mismatch on five test barcodes is far cheaper than reprinting five hundred.
Related Guides
- How to Create a Barcode in Excel - the same font and image-based approaches, adapted for Excel's formula syntax
- Bulk Barcode Generator Guide - generate hundreds of barcodes from CSV data outside a spreadsheet
- Code 39 Complete Guide - the format behind the simplest barcode font method
- How to Create a QR Code for Wi-Fi - the exact data string QR codes need for Wi-Fi, contacts, and more
Sources
- Libre Barcode 39 - Google Fonts - the free, open-source barcode font family available directly in Google Sheets' font menu.
- IMAGE function - Google Docs Editors Help - Google's official documentation for the formula used to pull barcode and QR code images into a cell.
- Free Online Barcode Generator: Code-128 - TEC-IT - documentation for the free barcode image API used in the Code 128 formula example, including its non-commercial use terms.
- QR code API: create-qr-code - goQR.me - documentation for the free, key-less QR code generation API used in the QR code formula example.