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:

  1. Shortcut to quickly visit a website.
  2. Shortcut to an app download.
  3. Mobile boarding passes.
  4. Making payments (e.g. to Bitcoin or Lightning addresses).
  5. Setting up 2FA.
  6. Restaurant menus (scanning the QR code with your smartphone will take you to a website displaying the menu).
  7. 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. :)

Tags: howto, google sheets, google sheets tips, qr code