Blog
A QR Code in Google Docs, or One That Opens the Doc
On this page
2 jobs go by the name QR code in Google Docs, and each takes its own steps. For a code inside the doc, make it in a QR code generator, copy it and paste it in, or download a PNG and use Insert, Image, Upload from computer. For a code that opens the doc, set General access to Anyone with the link, copy the link, cut it at /edit and make that the code.
Google DocsFor Google Docs: pasting the code, the share link and who can open it
The second job is where codes break. We opened every common form of a Google Docs link while signed out, as a stranger’s phone would. A restricted doc sent every device to a Google sign in page, and a ?usp=sharing tag on the end of a link made the code denser without changing what opened.
The test: Google Docs links, opened while signed out
Google’s Docs API quickstart reads a sample doc that anyone can open. We requested 13 forms of its link with plain HTTP and no Google cookies, as desktop Chrome, iPhone Safari, Android Chrome and a plain script, and followed each redirect by hand. Then we opened the main forms in headless Chromium, at desktop size and as an iPhone.
For the failures we used a doc linked from a Google Workspace Marketplace listing but not shared publicly, a doc from a Google Drive help forum thread that has since been deleted, and an ID we made up. A doc published to the web, linked from a college’s Google Sites page, gave us a published link.
What the links did:
- On a computer,
/edit,/viewand/previewopened the doc with no redirect. Once it loaded, Docs rewrote the address to end in?tab=t.0and dropped the?usp=tag./previewshowed the page alone, with no toolbar. - On a phone, all 3 redirected once to Google’s mobile view, a plain reading page with a prompt to get the Google Docs app. We did not test the app itself.
- The bare
/d/<id>link is shorter and slower: 2 redirects on a computer, 3 on a phone. - A
/copylink asked for a sign in, even on the public doc. - A published
/publink opened directly on every device, with no toolbar and no app prompt.
How big a code each link makes
A longer link needs a bigger grid, and a bigger grid at the same printed width means smaller modules. Each code below is at error correction level M, printed 2.5 cm wide with its quiet zone. The sample doc’s ID is 44 characters, as were the restricted and deleted ones.
| Grid | Module at 2.5 cm | |
|---|---|---|
| A QRplify dynamic code's short link, 30 characters | 29 × 29 | 0.68 mm |
Bare /d/<id>, 79 characters | 37 × 37 | 0.56 mm |
Cut at /edit or /view, 84 characters | 37 × 37 | 0.56 mm |
Ending /edit?tab=t.0, 92 characters | 41 × 41 | 0.51 mm |
Ending /edit?usp=sharing, 96 characters | 41 × 41 | 0.51 mm |
Published, ending /pub, 127 characters | 49 × 49 | 0.44 mm |
Deleting ?usp=sharing takes the code from a 41 grid to a 37 grid. The short link gives modules a third bigger than the full link with the tag.
What a scanner sees when the doc does not open
| What a signed out scanner sees | HTTP answer | |
|---|---|---|
| Anyone with the link | The doc | 200 |
| Restricted | Google's sign in page | 401 |
| Deleted doc | A Google page saying the file was deleted | 410 |
| A wrong ID, such as a typo | A Google page saying the file does not exist | 404 |
Any doc, through a /copy link | Google's sign in page | 2 redirects, then sign in |
Only Anyone with the link reached the doc. Google’s help on file access explains why: a file that is not public opens only for a signed in account the owner shared it with.
What that means for your link:
- Set General access to Anyone with the link, and check it in a private browser window before you print.
- Cut the copied link at
/edit. Everything after it changed nothing in our test and cost a grid size. - Put a long link in a dynamic code. A
/publink, or any link you may change, fits better behind a 30 character short link.
Chrome’s QR code, and when it is enough
Google Docs has no QR code maker of its own. The nearest Google tool is Chrome on a computer: with the doc open, choose More, Cast, save, and share, then Create QR code. Chrome’s help lists 3 choices from there: copy the link, download the code, or scan it with another device.
Chrome’s code holds the address in your tab, which in our signed out test ended in ?tab=t.0: a 41 × 41 grid. Chrome also puts its dinosaur in the middle.
| Chrome's Create QR code | QRplify | |
|---|---|---|
| Opens | The page in your tab | Any link you paste |
| Files | Download the image | Copy, or PNG, JPG and SVG up to 4096 px |
| Change the doc after printing | Not stated on the page | Yes, with a dynamic code |
| Scan counts | Not stated on the page | Scans by city, device and time, on a dynamic code |
Pick by the job:
- 1 code, for a doc that will not move, on paper you print once: Chrome’s code is enough.
- A poster, a worksheet you reuse or a sign that stays up, or you want scan counts: use a dynamic code from a QR code generator.
QRplify has no Google Docs add-on, and you do not need one: Docs takes the code as a plain image. Google’s Workspace Marketplace lists QR add-ons from other makers, if you want the code drawn inside Docs.
How to add a QR code in Google Docs
- Make the code. Paste your link into the free URL QR code generator. It needs no account and makes a static code: the link sits inside the pattern.
- Copy it. Click Copy to put the image on your clipboard, where your browser allows it. Or download it as a PNG.
- Put it in the doc. Click where the code goes and paste with Ctrl+V, or Command+V on a Mac. For a file, Google’s steps are Insert, Image, Upload from computer, then Insert or Open.
- Size it. Click the code, then Image options, All image options, and set the size under Size & Rotation. Check it is still square.
- Test it. Scan it on screen with a phone, or open a screenshot in the free QR code decoder to see the link inside.
Use PNG or JPG, not SVG. Google’s developer reference for adding images to a doc lists PNG, JPEG and GIF, under 50 MB and at most 25 megapixels. A 4096 × 4096 PNG is 16.8 megapixels, inside that limit. The same reference says Docs fetches the image once and stores a copy in the document, so the code in the doc does not change if the original file does.
Writing in Word instead? The picture route is the same, and Word for Windows can draw the code itself with a field code, as how to create a QR code in Word shows. Google Slides takes the code through Insert, Image too, and the PowerPoint and Google Slides guide has sizes for a projected slide.
How to make a QR code that opens your Google Doc
- Open the share settings. In the doc, click Share.
- Open the link to everyone. Under General access, click the arrow and choose Anyone with the link. Google’s sharing help says anyone with the link can then open the file without signing in to a Google Account.
- Pick Viewer. Viewers can read the doc but cannot change it, comment or share it. Pick Editor only if everyone holding the paper should edit.
- Copy the link and trim it. Click Copy link, then Done. Delete everything after
/edit. - Make the code. Paste the trimmed link into the dynamic QR code generator, or the static one above if the doc will never change.
- Test it signed out. Open the link in a private browser window, then scan the printed code with a phone that is not signed in to your account.
On a work or school account, Anyone with the link may not be on offer: Google’s help says your administrator may restrict external link sharing.
For a large audience, Google suggests Publish to web, under File, Share. It gives the doc a new address with no toolbar that updates a few minutes after each edit. At 127 characters it made the densest code in our test, so put it behind a dynamic code.
Swap the doc without reprinting
A static code holds the doc’s link. Start a new doc for next term, delete the old one or switch it back to Restricted, and every printed code ends on a Google error or sign in page.
A dynamic QR code holds a short link in place of the doc’s link. You change where it points in your account, and every printed copy opens the new doc. It adds 1 redirect of its own before Google’s. A free QRplify account includes unlimited dynamic codes.
Each dynamic code also counts its scans, with city, device and time, as QR code tracking shows. For 1 code per doc, such as a class set of worksheets, import the links from a CSV file, up to 1,000 per import on the free plan. QR codes in Google Sheets shows how to build that CSV.
The limit, before you plan around it: on a free account, once your codes pass 100 scans in a month, scans show a QRplify screen for 3 seconds before the doc opens. Premium skips that screen on 5 codes, and the Unlimited and Lifetime plans never show it. Pricing lists what each plan adds.
Print it so it scans
A full doc link makes a 37 or 41 grid where the short link makes a 29, so print it 3 cm wide or more on a handout. The short link holds up at about 2 cm from close range. Keep the quiet zone, the empty margin around the code, clear of text and table borders. How small can QR codes be has the measured minimums, and QR code best practices covers color, contrast and logos.
FAQ: QR codes in Google Docs
Can you put a QR code in Google Docs?
Yes. Copy the code’s image in a QR code generator and paste it into the doc, or use Insert, Image, Upload from computer with a PNG. Docs has no QR code maker of its own and needs no add-on to show the code.
Why does my Google Docs QR code ask people to sign in?
The doc is set to Restricted, or the code holds a /copy link. In our signed out test, both sent every device to Google’s sign in page. Set General access to Anyone with the link, then scan the printed code again from a phone that is signed out.
Is there a QRplify add-on for Google Docs?
No. QRplify has no add-on and does not connect to your Google account. Docs takes the code as a plain image, so nothing needs installing.
Can I change which doc a printed code opens?
Only if the code is dynamic. A static code holds the doc’s link, so a new doc means a new code. A dynamic code holds a short link you point at the new doc from your account, and every printed copy follows.