Excel QR Code Formula: Create QR Codes from Cell Data

Formulas & functions · Updated November 18, 2026

Excel has no built-in QR-code function, but in Microsoft 365 for Windows you can display a QR code from cell data with the IMAGE and ENCODEURL functions. Put the text or URL in A2, then enter =IMAGE("https://api.qrserver.com/v1/create-qr-code/?size=180x180&data="&ENCODEURL(A2),"QR code for "&A2,0) in B2; Excel requests an image from an online QR-code service and shows it in the cell.

The Excel QR Code Formula at a Glance

The formula combines three things: a web address for a QR-code image service, the value in A2 encoded so it can safely be included in a web address, and Excel’s IMAGE function to display the returned picture. In this example, A2 contains the QR code’s payload: the text, link, or other information that a phone should read. B2 shows the resulting image.

The formula assumes the payload is in A2 and the QR image should appear in B2. If A2 contains https://example.com/menu, the generated QR code represents that URL; the visible result in B2 is an image, not the URL text. The third argument, 0, tells IMAGE to fit the picture in the cell while maintaining its proportions. Make column B wide and row 2 tall enough to see the full code.

This is not a self-contained Excel QR generator. IMAGE displays an image loaded from the internet, and the formula calls the third-party service at api.qrserver.com. That distinction matters if the workbook must work offline, if your organization blocks external images, or if the content is confidential.

How the Formula Works

The service’s address includes a size setting and a data parameter. The text after data= is what the QR code represents. The formula joins that address to the contents of A2, while ENCODEURL changes characters such as spaces, ampersands, and question marks into a form suitable for a URL. Without encoding, those characters could be mistaken for part of the service address rather than part of your message.

IMAGE fetches the image at the completed address and places it in the cell. Its second argument supplies alternative text for accessibility, here based on the source cell. Its third argument controls display sizing: 0 fits the image in the cell, 1 fills the cell (and can distort the image), 2 uses the original image size, and 3 lets you specify height and width. For a square QR code, fitting the cell is usually a sensible starting point.

The formula requires a version of Excel that supports IMAGE, and the Windows desktop version of Microsoft 365 includes it. ENCODEURL is available in Excel for Windows but not in Excel for the web or Excel for Mac. If you share a workbook across platforms, check the recipient’s Excel version and test the formula there; function availability and access to external images are separate requirements.

Set Up a List of QR Codes

For a batch of codes, keep each payload in one column and put the image formula beside it. For example, with web addresses in A2:A20 and QR codes intended for B2:B20, enter the formula in B2 and copy it down. Each row then uses its own value from column A. The formula result in each row is an image, so the cell does not behave like a text value you can copy into a message.

  1. Enter one destination or message per row in column A. Use complete links, including https://, when you want a phone to open a website.
  2. Put the QR formula in B2, following the layout above. Confirm that A2 contains the exact content you want encoded.
  3. Copy B2 down the list with the fill handle or copy and paste. Relative references change from A2 to A3, A4, and so on.
  4. Adjust the row height and column width so the image is large enough to scan, then scan a few samples with a phone before distributing the workbook or printing labels.

For a readable worksheet, use a separate column for a description such as “Front desk” or “Product 104” and another for the actual destination. Keep the payload itself visible too: if a link changes later, you can update the source cell and the QR image should refresh. A blank source cell is not a useful QR payload, so consider filtering out empty rows or leaving the output blank until data is entered.

What You Can Put in a QR Code

A QR code can represent more than a website address. Depending on the scanning app and the format, it can contain plain text, contact details, Wi-Fi connection information, or other structured data. Excel does not decide how the phone will interpret the content; it simply sends the cell’s text to the image service. For broad compatibility, use a normal HTTPS link or a short, clearly formatted text string.

For example, if A2 contains https://example.com/menu, the code points to that page. If it contains “Room 204 — check in at reception,” a scanner will show that text instead. Do not assume that putting a phone number, email address, or Wi-Fi password in a QR code automatically opens the right phone action: support depends on the exact data format and the scanning application.

Long payloads generally require a denser QR pattern, which can become harder to scan when printed small or viewed at low resolution. A short URL is often more practical than encoding a long paragraph or a lengthy tracking link. If a destination changes, a printed QR code does not update merely because the spreadsheet changes; only the image displayed by a recalculating workbook changes. Consider a redirect or managed destination if you need printed codes to keep working after the target changes.

Display, Printing, and Sharing

QR images in this setup are retrieved online rather than stored as ordinary text. The workbook therefore needs a network connection and permission to load external images when Excel calculates or refreshes the result. A recipient who opens the file offline may see a missing image or an error instead of a scannable code. The same issue can arise when a company’s security policy restricts external content.

For print use, make the cell large enough that the code is sharp and has a clear margin around it. Avoid placing text or borders over the code. Print a sample at the actual intended size, then test it with more than one phone or scanning app and in the lighting conditions where it will be used. A QR code that looks fine on a large monitor may be too small on a label.

When sharing the workbook, test it on the recipient’s Excel platform and check that the image loads. If people only need the final code, inserting or distributing a downloaded image may be more dependable than asking them to recalculate a formula. Be aware that a displayed image can still be linked to an online source rather than embedded, depending on how it is handled; verify the file and its behavior before relying on it offline.

Privacy and Service Considerations

The payload is included in a request to an external QR service. Do not use this method for confidential material, private customer data, access tokens, or any information your organization prohibits sending to a third party. Even when the formula itself is inside a private workbook, the service must receive the data to generate the image. Review the provider’s current privacy terms, usage conditions, availability, and any applicable limits before using it for business or high-volume work.

There can also be practical limits on the amount of data, image size, or number of requests a service will handle. Those terms may change, so avoid treating an online endpoint as a guaranteed production dependency. For large-scale distribution, branded codes, analytics, or a service-level commitment, compare providers and check what happens to the destination data. A paid QR platform may offer management features, but pricing and capabilities differ and should be verified with the provider.

Common Problems and Fixes

  • The formula name is not recognized: Check whether the Excel version supports IMAGE and whether you are using Excel for Windows. ENCODEURL is not available in Excel for Mac or Excel for the web, so the formula may need a different workflow on those platforms.
  • The cell shows an image error or nothing: Check the internet connection, the service address, and Excel’s external-content security settings. A blocked request, unavailable service, or unsupported Excel version can prevent the image from loading.
  • The code scans to the wrong place: Read the source cell carefully. Extra spaces, a missing character, or a link copied from the wrong row changes the encoded content. Scan the displayed image and compare the result with the exact cell value.
  • The QR code is too small or blurry: Increase the cell dimensions and print size, and use a service image resolution suitable for the intended output. Test a physical print rather than judging only from the worksheet view.
  • Special characters break the result: Keep ENCODEURL in the formula. Characters such as ampersands and spaces need URL encoding so they remain part of the payload. If you manually construct a service link, encode the data correctly rather than simply pasting raw text after data=.
  • A blank row still displays an image: The formula is still requesting a code for an empty value. You can avoid that with a conditional formula, but the basic formula is simpler for a fixed, fully populated list.

Alternatives to an Excel Formula

If you need the codes to work offline or your Excel platform lacks one of the required functions, generate QR images with a reputable QR-code application or service and insert the resulting image files into the workbook. This separates code creation from spreadsheet calculation and can make a workbook easier to share. The trade-off is that images may need to be regenerated and replaced when the payload changes.

An Excel add-in may also generate QR codes, but add-ins can involve permissions, compatibility requirements, or fees. Review the publisher and data handling before installing one, especially for a work account. For recurring commercial use, a managed QR platform can provide reporting or editable destinations, but those features are provider-specific and may require a subscription.

Choose the formula approach when the payloads are ordinary, non-sensitive data, you use supported Excel for Windows, and a live internet connection is acceptable. Choose static image files or a dedicated tool when you need offline access, consistent output across devices, advanced design, or tighter control over how data is transmitted.

Frequently Asked Questions

Does Excel have a built-in QR code formula?
No. Excel does not provide a native QR-code function. The approach above uses IMAGE to display a QR image made by an external web service, with ENCODEURL preparing the cell data for the request.

Can I make a QR code in Excel for Mac or Excel for the web?
The exact formula shown depends on ENCODEURL, which is unavailable in Excel for Mac and Excel for the web. You can generate a code with an external tool and insert its image, or use another supported workflow, then test the workbook on the platform where it will be used.

Can I create QR codes for many rows at once?
Yes, in supported Excel for Windows. Put one payload per row, enter the formula beside the first payload, and fill it down. Each row’s formula then refers to that row’s source cell.

Will the QR code keep working if I change the source cell?
The formula-generated image can update to represent the new value after recalculation and a successful image request. A code already printed, saved as a separate image, or shared outside the workbook does not change when the source cell changes.

Is it safe to encode passwords or private information?
Not with this web-service formula unless your organization has approved that provider and data flow. The payload is sent to the external service as part of the image request. Use a trusted, approved method for sensitive content and check the provider’s current terms.

Related

Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.

More in Formulas & functions

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.