How to create a QR code in Microsoft Word
Word for Windows can draw a QR code itself with the DisplayBarcode field. Here is the exact syntax, useful switches, and the image method for Mac and web.
Add LearnQRCode as a preferred source on Google
Quick answer
- Word for Windows: press Ctrl + F9, type
DisplayBarcode "https://example.com" QR \q 3in the braces, then right-click > Toggle Field Codes. - You must press Ctrl + F9 to create the braces. Typing { } on the keyboard won’t work.
- On a Mac or in Word for the web, DisplayBarcode isn’t supported: insert a QR code image instead.
QR code in Word (Windows) in 4 steps
- 1Press Ctrl + F9Typed braces won’t work
- 2Type the DisplayBarcode fieldDisplayBarcode "https://…" QR \q 3
- 3Right-click, Toggle Field Codes
- 4Scan it to checkMac or web: insert a QR code picture
In this guide
Word for Windows can generate a QR code itself with a little-known field code, DisplayBarcode. On a Mac or the web, make the code elsewhere and insert it as a picture.
Method 1: The DisplayBarcode field (Word for Windows)
Microsoft documents DisplayBarcode for Word for Microsoft 365, Word 2024, 2021, 2019 and 2016 on Windows.
-
Click where the QR code should go.
-
Press Ctrl + F9. Grey braces
{ }appear. Microsoft says typing braces on the keyboard won’t work. -
Type inside the braces:
DisplayBarcode "https://www.example.com" QR \q 3 -
Right-click and choose Toggle Field Codes. The text becomes a QR code.
-
Scan it to confirm the address.
To edit, toggle field codes again, change the text and toggle back. If it doesn’t refresh, right-click > Update Field.
What each part means
Microsoft’s syntax is { DisplayBarcode field-argument-1 field-argument-2 [ switches ] }:
"https://www.example.com": the data, in straight double quotes. Any text works.QR: the barcode type. Word supports ten types, including CODE128, CODE39, EAN13 and UPCA.\q 3: optional error correction level.
Field codes are not case-sensitive.
Useful switches
From Microsoft’s reference; add them after QR, separated by spaces.
| Switch | What it does | Example |
|---|---|---|
\q |
Error correction level, 0 to 3 | \q 3 |
\s |
Scale, in whole percent from 10 to 1000 | \s 150 |
\h |
Height of the symbol, in twips (1/1440 inch) | \h 1440 |
\f |
Foreground (dark) colour as an RGB value from 0 to 0xFFFFFF | \f 0x14213D |
\b |
Background colour as an RGB value | \b 0xFFFFFF |
\r |
Rotation, 0 to 3 | \r 0 |
\t |
Shows the data as text with the image | \t |
Example, larger with navy modules:
DisplayBarcode "https://www.example.com/menu" QR \q 2 \s 150 \f 0x14213D
Which error correction level?
DENSO WAVE describes four levels, L, M, Q and H, restoring roughly 7%, 15%, 25% and 30% of the codewords; M is most often chosen. Higher levels are more robust but denser. Word’s \q accepts 0 to 3, one per level, and Microsoft’s example uses \q 3. Use a middle value for clean paper, higher if the code may get scuffed or folded, and always scan a printed test.
Method 2: Insert a QR code image (Mac, web and everything else)
Microsoft says DisplayBarcode is supported in Word for Windows on the desktop only.
- Create the QR code. Use any QR code generator (for example QRJiffy’s link QR code generator, made by our publisher, DPR Software Labs), or Chrome or Edge’s built-in “Create QR code” option for a web page. See making a QR code for a link.
- Download it as PNG, or SVG if your Word supports it and you will print (SVG stays sharp).
- In Word: Insert > Pictures > This Device, choose the file, select Open.
- Resize from a corner handle to keep it square.
- Test on screen and on a printed copy.
If the field doesn’t turn into a QR code
- You see text, not a code: right-click > Toggle Field Codes.
- Braces with no grey shading: they were typed. Delete and use Ctrl + F9.
- Nothing renders: use straight quotes (
"), not curly, with spaces between parts. Microsoft notes unacceptable data may not render.
Tips for QR codes in documents
- Leave white space around it (a “quiet zone”); don’t wrap text tightly. See QR code size.
- Don’t shrink it into a footer. Print a test page and scan.
- Keep it dark on light. See QR code colours.
- Say what it does, such as “Scan to view the full report online”.
- Check the PDF too, on screen and printed. See printing QR codes.
Frequently asked questions
- Does Microsoft have a QR code generator?
- Word for Windows has one built in through the DisplayBarcode field code, and Microsoft Edge can create a QR code for any web page you are viewing. Neither needs an add-in.
- Can I generate a QR code for a Word document?
- A QR code can’t contain a whole document. Upload the document somewhere people can open it, such as OneDrive or your website, copy the share link, and make a QR code for that link.
- Why does my DisplayBarcode field show an error or nothing at all?
- The most common causes are typing the braces instead of pressing Ctrl + F9, missing quotation marks around the data, or data the barcode type can’t accept. Microsoft notes the barcode may not render if the data doesn’t meet the requirements.
- Can I make QR codes in Word with mail merge?
- Yes. Word has a separate MergeBarcode field for creating a different barcode for each record in a mail merge.


