NOTE: You will need to be logged in to your Google account for this to work properly.
Creating the Workbook
The first step in creating a QR code in Google Sheets is to open your favorite browser and type “sheets.new” (without the quotes) in the Location Bar.
This will start a new Google Sheets workbook and automatically save it in your Google Drive.
It would be a good idea to give the new workbook a better name. Feel free to change the workbook name to something other than “Untitled spreadsheet”.
If you are unhappy with the save location of the file in your Google Drive, you can click the Move button to relocate the file to a better location.
Establishing the Links
The next step is to create a list of the link or links that you wish to generate QR codes from.
Writing the QR Code Generator Function
Google Sheets does not possess a specific function to generate QR codes, but you can use the IMAGE function to call a URL that will generate the QR code.
The requirements for the IMAGE function’s URL are the link to the Google API along with the desired size and cell address that holds the Web link.
Information on the Google API can be found at the following address:
(See what I did there? 😊 )
The requirements for generating the QR code are:
- The root URL – https://chart.googleapis.com/chart?
- The QR code request option – cht=qr
- The image size defined as <width> x <height> – ex: chs=500×500
- The URL for the image – chl=
You can also define the output encoding and error correction if needed. See the online Google API documentation for details.
A generic version of an API call would look like the following.
In the below example, we are placing the URL to a website in a separate cell.
The IMAGE function is accepting the Google API link concatenated with a cell reference (B1) to create and retrieve the QR code and place it in a cell.
Notice how each of the QR code API elements is concatenated using the “&” character.
By enlarging the height of the rows, we get a clearer image of the QR code.
By dragging the formula down to adjacent rows, we can generate QR codes for all the desired links.