How to Create a QR Code for a Link (URL) — Step-by-Step Guide
Creating a QR code for a link takes seconds. Getting the right link into it takes a little more thought — here is which URL to copy for each kind of destination, and how its length changes the code you print.
How to Create a QR Code for Any Link
The most common use of a QR code is opening a link — a website, a social profile, a Google Maps location, a YouTube video, a shared document. Making one takes three steps:
- Open the page you want people to land on, and copy the URL from the address bar after it has finished loading
- Paste it into our free QR Code Generator
- Download the code, then scan it with two different phones before you print anything
The code is generated in your browser — no account, no sign-up, no watermark, and nothing in the middle that can stop working later.
The rest of this guide is about step 1, because that is where most link QR codes go wrong. The generator will encode whatever you give it, so a link that is too long, that redirects twice, or that only works when you are logged in makes a worse code no matter which tool you use.
Step 1 Matters Most: Encode the Final URL
Many links do not go straight to their page. http:// forwards to https://, example.com forwards to www.example.com, a path without a trailing slash forwards to one with it, and a shortened link forwards to the real address. Each of those hops is a separate request the phone has to make before anything appears on screen — fine on office Wi-Fi, noticeable on a weak mobile signal outside a shop.
Worse, every hop is something that can break after you print. If you later change domains or tidy up your redirects, the codes already on posters stop working. The fix is cheap: load the link in a browser, wait for it to settle, and copy what the address bar shows then. That is the address the code should hold.
If you are not sure where a link ends up, paste it into the QR code link checker. It shows the real domain a link opens and flags shorteners and hidden redirects — the same checks a cautious person scanning your code would want to make.
How Your Link Changes the QR Code
A QR code is a grid of squares called modules, and the grid grows as you put more characters in it. There are 40 sizes, called versions: version 1 is 21 × 21 modules and each step up adds 4 in each direction. A bigger grid printed at the same size means smaller modules, and smaller modules are harder for a phone camera to pick out from a distance or in poor light.
We encoded some typical links at error-correction level M (what most generators, including ours, use by default) and measured the result. The last column is how wide each module comes out if you print the code 25 mm across — about the size of one on a business card.
| Link | Characters | Version | Grid | Module at 25 mm |
|---|---|---|---|---|
Bare domain (https://example.com) | 19 | 2 | 25 × 25 | 1.00 mm |
YouTube share link (youtu.be/…) | 28 | 3 | 29 × 29 | 0.86 mm |
Google Maps share link (maps.app.goo.gl/…) | 41 | 3 | 29 × 29 | 0.86 mm |
YouTube full link (youtube.com/watch?v=…) | 43 | 4 | 33 × 33 | 0.76 mm |
| Blog post with a descriptive slug | 60 | 4 | 33 × 33 | 0.76 mm |
| Page with three UTM tags | 87 | 6 | 41 × 41 | 0.61 mm |
| Google Maps link copied from the address bar | 163 | 9 | 53 × 53 | 0.47 mm |
Two things stand out. First, the jumps are steps, not a slope: a 28-character link and a 41-character link both land on version 3, so trimming a few characters only helps when it takes you below a threshold. Second, the worst offender is not a long page name — it is a link copied from the wrong place. The Google Maps address-bar URL makes a code with modules less than half the width of the share link that goes to exactly the same pin.
To see where your own link lands, paste it into the QR code capacity calculator, then use the print size calculator to turn that into a physical size for the distance people will scan from.
Which Link to Copy, by Destination
Most apps offer two versions of the same address: the one in the address bar and the one behind the Share button. For a QR code, the Share version is usually shorter and more stable — but often carries a tracking parameter you can remove.
YouTube video or channel
Use Share → Copy link to get a youtu.be address. The copied link usually ends in ?si= followed by a code that identifies who shared it; delete everything from the ? onwards and the link still works. To start the video at a particular moment, add ?t=90 (seconds) instead. For a channel, the handle form — youtube.com/@yourname — is short and survives channel renames better than the long channel ID.
Google Maps location
Search for the place, tap Share and copy the maps.app.goo.gl link. Do not copy the address bar on a desktop browser: as the table shows, that URL carries map coordinates, zoom level and a long data string, and makes one of the densest codes you are likely to print. If the code is for your own business, share the business listing rather than a dropped pin, so the code opens your opening hours and reviews, not just a location. To send people straight to the review form instead, see how to create a Google review QR code.
Instagram, TikTok, Facebook, LinkedIn
For a profile, type the address yourself rather than copying it from the app: https://www.instagram.com/yourname/ is shorter than a shared link, and the in-app Share button adds a tracking parameter (?igsh= on Instagram) that adds characters for nothing. Most phones open these links in the platform's app if it is installed, and in the browser otherwise.
WhatsApp chat
Use a wa.me link with your number in international format and no plus sign or spaces. You can also pre-fill a message. The WhatsApp QR code generator builds the link and the code together and catches the formatting mistakes that make these codes fail.
Google Drive, Dropbox or OneDrive file
Change the file's sharing setting to anyone with the link can view before you copy the link. A link that is restricted to your organisation works perfectly when you test it — because you are signed in — and shows a sign-in page to everyone else. Test from a phone that is not logged into your account, or a private browser window. Our guide to making a QR code for a PDF covers hosting choices in more detail.
An app on Google Play and the App Store
A QR code holds one link, and the two stores use different ones. Either print two codes labelled clearly, or point one code at a page on your own site that links to both stores. The second option also gives you somewhere to send people who are on a laptop.
Making a Link Shorter Without a Shortener
- Strip share-tracking parameters such as
?si=,?igsh=or?fbclid=. They identify the sharer, not the page. - Keep only the UTM tags you will read.
?utm_source=flyeralone took our example page from version 6 down to 4. If you only ever look at the source, the medium and campaign tags are dead weight. - Drop
www.only if your site serves the bare domain directly. If it redirects towww, you have saved four characters and added a hop. - Use a short path on your own domain. A page at
example.com/menubeats a third-party shortener: it is just as short, it carries your brand, and it cannot be switched off by someone else.
A less obvious trick: QR codes have a compact mode for capital letters, digits and a few symbols. Written entirely in capitals, HTTPS://EXAMPLE.COM/SPRING-MENU fits in version 2, where the lowercase version needs version 3. Scheme and domain are case-insensitive, so they are always safe to capitalise, but the path often is not — only use it if your server treats /SPRING-MENU and /spring-menu as the same page. Check by typing the capitalised address into a browser before you generate the code.
Tracking Scans Without a Paid Service
A static QR code does not count its own scans, but your analytics can. Add UTM parameters to the link — the UTM link builder makes this quick — and visits from the code show up as their own source in Google Analytics. Use a different utm_source for each placement (flyer, poster, packaging) to compare them. Keep the tags short, for the reason in the table above. We go further in tracking QR code scans without a subscription.
Test Before You Print
Scan the code with at least two phones — ideally one iPhone and one Android — and check:
- The preview shows the address you expect. Both iPhone and Android cameras show the link before opening it. If it looks unfamiliar to you, it will look suspicious to a stranger.
- It works on mobile data, not just your Wi-Fi, and from a phone that is not signed into your accounts.
- The page is usable on a phone and loads quickly, because everyone arriving from the code is on one.
- It scans at the real size and distance. Print one copy at the final size and try it from where people will actually stand.
Printing Your QR Code
- Size: about one tenth of the scanning distance — 2–3 cm for something held in the hand, 20 cm for a sign read from two metres. Denser links need more.
- Format: SVG or PDF for print, PNG for screens. Never JPEG — its compression blurs the module edges scanners rely on.
- Quiet zone: leave a clear margin at least four modules wide on every side, and do not let a designer crop it.
- Contrast: dark modules on a light background. Brand colours are fine if the contrast holds — check with the colour contrast checker.
Static or Dynamic?
Everything above describes a static code: your link is written into the pattern itself, so it is free and works for as long as the link does. A dynamic code holds a link to someone else's server, which redirects to yours — useful if you need to change the destination after printing, but it adds a hop and usually a subscription, and the code stops working if you stop paying. Pointing a static code at a short page on your own domain gets you most of the flexibility with none of the dependency. Static vs dynamic QR codes compares the two properly.
Common Mistakes
- Copying the link before the page finished loading, and encoding a redirect instead of the destination
- Encoding a link that only works when signed in — a private Drive file, an internal wiki, an admin URL
- Leaving out
https://. Some scanner apps treat a bareexample.comas plain text rather than a link - Relying on a free shortener you do not control. If it shuts down or changes its terms, every printed code breaks at once
- Printing hundreds before scanning one. One test print at final size costs nothing
Frequently Asked Questions
Is a QR code for a link free to use commercially?
Yes. A QR code is an encoding of your own URL, and the symbol itself carries no licence and no per-scan fee — the QR patent held by Denso Wave was made freely available for use under the published ISO/IEC 18004 standard. What can cost money is a <em>dynamic</em> QR code, where a third party hosts a redirect for you and charges for it. A static code pointing straight at your own URL costs nothing, forever.
Do QR codes for links expire?
A static QR code does not. It is a printed encoding of your URL, so it keeps working for as long as that URL does — the code has no expiry and no server behind it. What expires is either the link itself, if you take the page down, or a dynamic code whose provider stops redirecting when a subscription lapses. If you want a code on printed material to last, point it at a URL you control.
Can I change the link in a QR code after printing it?
Not in a static code — the URL is physically encoded in the pattern, so changing it means generating and reprinting a new code. The usual workaround is to encode a URL you control and redirect from your own end, which lets you change the destination without touching the print. We cover both approaches, and what each one costs you, in <a href="/blog/can-a-qr-code-be-changed-after-printing/">can a QR code be changed after printing</a>.
Why does my QR code not scan?
In rough order of likelihood: it is printed too small for the amount of data in it, there is not enough contrast between the dark and light modules, the quiet zone around it has been cropped away, or a logo has been placed over too much of the pattern. Long URLs make all of these worse because they force a denser grid. The <a href="/tools/qr-code-print-size-calculator/">print size calculator</a> will tell you the minimum size for your content and scan distance.
Should I shorten a URL before making a QR code?
Often yes, because a shorter URL needs fewer modules and so prints readably at a smaller size. But a shortener puts a third party between your code and your page: if that service disappears, every printed code breaks. If you shorten, prefer a redirect on your own domain. Check the size difference first with the <a href="/tools/qr-code-capacity-calculator/">capacity calculator</a>.
What is the best image format to download a QR code in?
For print, use a vector format such as SVG or PDF if your generator offers one, because it stays sharp at any size. For screens, PNG is right — it keeps the hard edges that QR decoders rely on. Avoid JPEG for QR codes entirely: its compression softens the edges between modules, which is exactly the information the scanner needs.
Can one QR code hold more than one link?
Not directly — a QR code holds one payload, and a URL payload is a single URL. To offer several destinations you point the code at one landing page of your own that lists them. That also leaves you free to change what is on that page later without reprinting anything.
Is it safe to scan a QR code on a poster or flyer?
Mostly, but the risk is real enough to be worth a habit: a sticker placed over a legitimate code is the most common QR attack, and you cannot tell by looking. Use a scanner that shows you the destination URL before it opens anything, and check the domain matches who you think you are dealing with. Our guide to <a href="/blog/qr-code-safety-fake-qr-codes/">spotting fake QR codes</a> goes through the tells.