Cover illustration for the article “How to Add a QR Code in Word and PowerPoint”
Tutorials

How to Add a QR Code in Word and PowerPoint

7 min read
Create a QR code

Word for Windows can draw a QR code itself. Press Ctrl+F9, type DISPLAYBARCODE "https://example.com" QR \q 3 inside the braces, then right-click and choose Toggle Field Codes. PowerPoint has no QR feature, so insert a QR code as an SVG with Insert > Pictures > This Device, or use an add-in. Avoid screenshots for anything printed.

The Word field always makes a static code: the address sits inside the pattern, so changing it later means updating the field and reprinting. The details below were checked against Microsoft Support in November 2026.

Make a QR code in Word with the DISPLAYBARCODE field

DISPLAYBARCODE is a Word field code, a small instruction that Word replaces with its result when it shows the document. Microsoft's DisplayBarcode field code page documents QR alongside nine linear barcode types. The syntax is:

{ DISPLAYBARCODE field-argument-1 field-argument-2 [ switches ] }

The first argument is the data in quotation marks and the second is the barcode type, here QR. Field codes are not case sensitive, so DisplayBarcode works as well as DISPLAYBARCODE.

  1. Click where the code should appear.
  2. Press Ctrl+F9. Word inserts a pair of field braces. Microsoft is explicit that typing curly brackets on the keyboard will not work.
  3. Inside the braces, type: DISPLAYBARCODE "https://www.example.com" QR \q 3
  4. Right-click the field and choose Toggle Field Codes to see the code.

Alt+F9 switches every field in the document between code and result at once. To change the address later, toggle back to the field code, edit the text inside the quotation marks, then click in the field and press F9, or right-click and choose Update Field. Microsoft's page on inserting, editing and viewing fields lists those shortcuts.

Microsoft notes that if the data does not meet the requirements of the chosen type, the barcode may not render. When nothing appears, check that the braces came from Ctrl+F9 and that the data sits inside one pair of quotation marks.

The switches that matter for a QR code

These switches change how a QR code looks. All of them come from the Microsoft Support page above.

SwitchWhat it doesValid values
\qError correction level0 to 3
\sScaling factor, in percent10 to 1000
\hHeight of the symbol, in twips (1/1440 inch)an integer
\f and \bForeground and background colouran RGB value from 0 to 0xFFFFFF
\rRotation0 to 3

Error correction is the share of the pattern a scanner can rebuild when part of it is damaged. The QR standard defines four levels, L, M, Q and H, which recover roughly 7, 15, 25 and 30 percent. Microsoft's support example uses \q 3. The Open XML specification for the same field, Microsoft's MS-OI29500, writes the switch with letters instead and gives \q h as the highest level. Use the numeric form shown on the support page. Our guide to QR code error correction levels explains when the higher levels are worth the denser pattern.

Keep \f dark and \b light. A scanner needs dark modules on a light field, and a field code gives you no warning when the contrast is too low.

A complete field with a dark grey code on white, the highest error correction level and double size:

{ DISPLAYBARCODE "https://www.example.com/menu" QR \q 3 \s 200 \f 0x222222 \b 0xFFFFFF }

Where the Word field works and where it does not

Microsoft states that DisplayBarcode is supported in Word for Windows desktop. Its page applies to Word for Microsoft 365, Word 2024, 2021, 2019 and 2016. The general field-codes article adds that inserting and editing fields is supported only in Word for Windows desktop, while some fields can be viewed or updated in Word for Mac or Word for the web.

In practice, build the code on a Windows PC. If the file goes to a colleague on a Mac or in a browser, export it to PDF first and check that the code is still there, rather than trusting that their Word will draw it.

For letters or name badges with a different code on every page, Word has a companion field, MERGEBARCODE, which takes a mail merge field name instead of quoted text. Microsoft's example is MergeBarcode URL QR \q 3, where URL is a column in your data source. Our article on QR code CSV workflows covers preparing that column. Spreadsheets are a different story, because Excel has no barcode field at all; the Excel QR code guide covers the workarounds.

Add a QR code in PowerPoint: an SVG or an add-in

PowerPoint has no barcode field and no built-in QR tool, so the code has to come from outside. There are two routes.

The first is to make the code in a generator, download it as an SVG, and insert it. Microsoft's support article on SVG images in Microsoft 365 gives the path as Insert > Pictures > This Device, then select the .svg file and choose Insert. The same path works in Word. The article lists SVG support in Word, PowerPoint, Outlook and Excel for Microsoft 365 on Windows, Mac and Android, and notes one gap: the iPhone and iPad apps can edit an SVG inserted elsewhere but cannot insert one.

The second route is an Office add-in that draws codes inside a task pane. In PowerPoint for Microsoft 365, on Mac and on the web, Microsoft's steps are Home > Add-ins, search, then Add. The catch is the file you send: a colleague who does not have the add-in may not be able to regenerate or edit the code. Read its privacy terms too, since the text you encode may be processed on its maker's servers.

Skip Convert to Shape on a QR code. It turns the code into hundreds of loose modules that one slip of the mouse can move.

Why an SVG beats a screenshot

An SVG describes the code as shapes, so it stays sharp at any size. Microsoft's article puts it simply: you can "resize the image without any loss of image quality". A screenshot is the opposite. It captures whatever the screen happened to show, at screen resolution, often after the browser had already scaled the image, so the module edges are soft before you even paste it.

Screenshots fail in quieter ways too. A tight crop removes the quiet zone, the blank margin of 4 modules that the QR standard requires, and our quiet zone guide explains why scanners give up without it. Stretching a small screenshot to fill a printed page blurs every edge. A PNG exported at the final size is acceptable for slides shown on screen. For print, use the SVG, as compared in the QR code SVG and vector guide.

Size it for the page and for the projector

Size a QR code by its modules, not by the page. A QR version 4 symbol is 33 modules across. With the 4-module quiet zone on each side it needs 41 modules of space. Printed 3 cm wide, each module is about 0.73 mm. Put a long URL in the same 3 cm and the code may move up to version 10, 57 modules across plus margin, and each module shrinks to about 0.46 mm. Shorter content buys you bigger modules at the same size, and so does a short redirect link.

The QR code size guide gives a placement table and the rule of scan distance divided by ten. That rule matters more in PowerPoint than in Word. A code on a projected slide is read from the back of the room, so it needs to fill a much larger share of the slide than looks natural on your laptop. Keep it on a plain light area of the slide, never over a photo or a gradient.

In Word or PowerPoint, resize an inserted code from a corner handle with the aspect ratio locked, and test it from the real distance before the deck or document goes out. If you want the destination to stay editable after printing, a dynamic code from a generator such as QRolling does that while its plan is active; creating and designing one there needs no login, and downloading the SVG needs an account with a 7-day trial and no card.

Frequently asked questions

Can I add a logo to a DISPLAYBARCODE QR code?

Not through the field. It has no logo switch. Placing an image over the code in Word covers modules and relies on error correction, so use \q 3 and keep the logo small, or make the code in a generator built for logos.

Why does my field show { DISPLAYBARCODE ... } instead of a code?

Word is showing the field code instead of its result. Right-click it and choose Toggle Field Codes, or press Alt+F9. If you typed the braces by hand, delete them and insert real ones with Ctrl+F9.

Will the QR code still work if I save the document as a PDF?

It should, if you export on a Windows PC where the code is showing. Scan the PDF on screen before you send it; that is the only real proof.

Share this article