How to Generate QR Codes in Google Sheets
A QR code (short for Quick Response code) is a two-dimensional barcode that allows you store a lot more data compared to standard UPC barcodes.
You can easily scan it with your smartphone's camera and because almost everyone now has a smartphone, it's becoming more and more popular.
Because QR codes can store more data, this also allows for many more use cases. They're especially very helpful as a shortcut for entering long texts where it's easy to make a mistake.
Some common use cases I've seen lately:
- Shortcut to quickly visit a website.
- Shortcut to an app download.
- Mobile boarding passes.
- Making payments (e.g. to Bitcoin or Lightning addresses).
- Setting up 2FA.
- Restaurant menus (scanning the QR code with your smartphone will take you to a website displaying the menu).
- Display information about a product.
If you're wondering how you can generate QR codes, you may be surprised to know that you can easily do this with a Google Sheets formula like this:
=IMAGE("https://image-charts.com/chart?chs=200x200&cht=qr&choe=UTF-8&chl="&ENCODEURL(A2))
This formula basically makes a call to the Google Charts API where we use the query parameters to pass in the settings for the chart. Here's a quick explanation of what the different parameters are for:
- chs - The chart size. In the example, we specified 200x200 pixels.
- cht - The chart type. In the example, we specified "qr" to generate a QR code.
- choe - The chart output encoding, where we specified UTF-8 in the example.
- chl - The data to encode. Must be URL encoded. Notice in the example that we used the ENCODEURL() function with the value in cell A2.
Here's an exampe of what an output will look like:
When you scan the QR code with your smartphone, you'll see the URL value which you can quickly tap to visit the site:
If you're a Shopify store owner and use our EZ Exporter app, you can also automate this by adding a Custom Field with this value in the app:
=IMAGE("https://image-charts.com/chart?chs=200x200&cht=qr&choe=UTF-8&chl="&ENCODEURL("https://{{ _shop_domain }}/products/{{ handle }}?variant={{ variants.id }}"))
You can export the data as a CSV and open it with Google Sheets to generate the QR codes or just push the data directly to an existing Google Sheets spreadsheet:
Pretty neat. :)
Related Posts:
- How to Import a Range From Another Sheet Within the Same Spreadsheet in Google Sheets
- How to Change CSV File Encoding to UTF-8 with Google Sheets
- How to Create a Basic Pivot Table in Google Sheets
- Google Sheets Tip: Compare Two Columns and Extract Missing Values
- Google Sheets Tip: Generate JSON Data from Rows and Columns
- Google Sheets Tip: Generate a Comma-Separated List of Values From a Column
- How to Display Images from URLs in Your CSV File Using Google Sheets
Tags: howto, google sheets, google sheets tips, qr code