Skip to main content

How to generate QR codes with Excel or Google Sheets

QR codes can be generated in spreadsheets with a special IMAGE() formula.

Start by putting your data in the first column of the spreadsheet. We’ll call this column QR data. It can contain a URL to your website, or any other text.

You can include variables such as utm_source and utm_campaign - the QR reader on modern phones can handle pretty much anything:

Example QR code data

Next, enter the following formula for the first row in column B, which we’ll label Image:


Excel/Google Sheets will render the QR code based on the data provided in cell A2:

Spreadsheet QR code with formula

To generate a QR code for every row in the spreadsheet, copy the formula to each row:

QR codes in spreadsheet

That’s it! You should be able to scan one of these QR codes with your phone.

QR sheet templates

To make things easier, we’ve created template spreadsheets. These spreadsheets automatically generate QR codes for URLs and other data you put in Column A.

To use in Excel, download the Excel template. This sheet includes IMAGE and ENCODEURL macros that are required for QR code generation.

Be sure to enable macros when you open the spreadsheet. If you receive an error that Microsoft has blocked macros in this file, follow these instructions from Microsoft to enable macros.

To use in Google Sheets, open this Google Sheets QR code template. Go to File > Make a copy in order copy it to your own Google Drive and start generating QR codes.

Generate QR codes with a spreadsheet
Google Sheets may ask you for permissions to load external data. This is necessary to render QR code images.

To proceed, click "Allow access".

Granting permissions to Google Sheets to view image

Customize the QR code

The QR codes we’ve seen so far are very basic. Did you know you can customize your QR code’s size, color, and margins? To customize the appearance of your QR code, start with the QR code builder and create a custom QR code.

You’ll notice that the generated QR code has size, margin, dark, and light parameters in the URL. Add these parameters to the QR code formula in the spreadsheet in order to customize your QR codes.

Further customization is described by the QR code documentation.

Stuck? Here’s how to get help

Get unstuck by asking your questions in the QuickChart community. We monitor community posts every day and will answer all questions related to QR code generation in spreadsheets.

Ian Webster

About the author

Ian Webster is a software engineer and former Googler based in San Mateo, California. He has helped Google, NASA, and governments around the world improve their data pipelines and visualizations. In 2018, Ian created QuickChart, a collection of open-source APIs that support data visualization efforts.

Email · LinkedIn · Twitter