Skip to content
Developer Toolkit IconDeveloper Toolkit
All Articles

Your Printed QR Code Will Outlive Your QR Code Vendor. What Developers Should Know Before Generating One

How QR codes work, why dynamic QR codes die when a vendor does, and how to build WiFi and vCard codes that scan reliably, with real capacity numbers.

By Muhammad Zeeshan~7 min read
Your Printed QR Code Will Outlive Your QR Code Vendor. What Developers Should Know Before Generating One

A restaurant prints 4,000 table cards. Each one has a QR code for the menu, made with a free online QR code generator that took about 30 seconds. Eight weeks later, every scan lands on a page asking the owner to upgrade to a paid plan to keep the code active. The menu is fine. The website is fine. The cards are fine, and every one of them is now useless.

This is the standard failure of the "dynamic" QR code, and it comes straight out of how many of those products make money. The code on your card doesn't point at your site. It points at the vendor's server, which forwards each scan to your site for as long as the account is in good standing.

What's Inside a QR Code

A QR code is a square grid of black and white modules. The three large squares in the corners are finder patterns. They let a scanner find the code, work out its orientation, and correct for the camera angle. Smaller timing and alignment patterns keep the grid straight on bigger codes.

The size of the grid is the version. Version 1 is 21 by 21 modules, and each version adds four modules per side, up to version 40 at 177 by 177. The rule is 17 + 4 × version.

Your data goes in using one of four modes: numeric, alphanumeric, byte, or kanji. The scanner is told which one at the start, so digits cost far less space than arbitrary text. Alongside the data, the code carries Reed-Solomon error correction at one of four levels:

LevelDamage it survivesMax bytes at version 40
Labout 7%2,953
Mabout 15%2,331
Qabout 25%1,663
Habout 30%1,273

More error correction means less room for data, and a denser grid for the same payload. Level M is a sensible default for clean prints. Reach for H when a logo covers the middle, or when the code will end up on a rough or curved surface.

Those capacities are theoretical ceilings. Almost nobody needs them, and you shouldn't try. The dense end of that table is where cheap scanners start to fail.

Static or Dynamic Is Just a Question of What Gets Encoded

A static code encodes the final destination. Scan it, and the phone opens exactly the URL inside it. There's nothing to expire, no account, and no server between your customer and your page.

A dynamic code encodes a short URL on the vendor's domain, something like qr.vendor.example/x7Kq. The vendor answers that request with a redirect. That layer is what gives you scan analytics and the ability to change the destination after printing. It's also what you're renting.

You can get the useful half of that without the rented half. Make the static code point at a short path on your own domain, such as example.com/menu, and handle the redirect yourself. You can change where it goes any time, count scans in your own logs, and nobody can switch it off.

Two details matter on that redirect. Use a 302, not a 301, because browsers cache permanent redirects and a code you print today might need a new destination next year. And keep the tracking parameters on the server side of the redirect, not inside the code. Which brings up the next point.

Shorter URLs Scan Better

Every extra character in the payload adds modules. More modules at a fixed printed size means each module is smaller, and smaller modules are harder for a phone camera to resolve at a distance or in poor light.

Here's the same code generated at error correction level M for three URLs:

PayloadLengthVersionGrid
A short redirect, https://example.com/m21 characters225 × 25
A tool page URL52 characters433 × 33
A menu link with UTM parameters, table number, and a campaign tag126 characters849 × 49

The last code has roughly half the module size of the first when printed at the same dimensions. That's the cost of putting analytics parameters into the code instead of into the redirect behind it.

Print Details That Decide Whether It Scans

Most "my QR code doesn't work" reports are print problems, not generation problems.

  • Quiet zone. The spec asks for a blank border of four modules on every side. Text, images, or a card edge pressing into that border breaks scanning on stricter readers.
  • Contrast. Dark modules on a light background is the safe choice. Light on dark, or low-contrast brand colours, fail on a surprising number of scanners.
  • Size. A rough minimum is 2 cm by 2 cm. For viewing from a distance, plan on about 1 cm of code per 10 cm of distance. A poster read from two metres wants a code near 20 cm.
  • Format. Export SVG for anything printed. A PNG scaled up for a banner will blur at the edges of the modules.
  • Test the real thing. Print the proof, and scan it with two or three different phones, including an older one, before you commit to a print run.

WiFi and Contact Codes

Two payloads are worth knowing because phones handle them natively. A WiFi code looks like this:

text
WIFI:T:WPA;S:CafeGuest;P:correct-horse-battery;H:false;;

Scanning it on a current Android or on iOS 11 and later brings up a join prompt. T is the security type (WPA, WEP, or nopass), S is the network name, P is the password, and H marks a hidden network.

The format uses ;, ,, :, \, and " as delimiters, so any of them inside a network name or password has to be escaped with a backslash. A network called Cafe;Guest becomes S:Cafe\;Guest. Skip that, and the phone reads the semicolon as the end of the field and tries to join a network that doesn't exist. This is the most common reason a WiFi code works for one network and fails for another.

A code that carries the password is a code anyone with a photo can use. Put it on a guest network, and treat the printed password as public.

A contact code works the same way, with a vCard as the payload. It carries a name, phone, email, organisation, and website. It's a bigger payload than a URL, so expect a denser grid and give it more room on the card.

A Code You Can't Read Is a Code You Can't Trust

QR phishing has a simple version. Someone sticks a printed code over the legitimate one on a parking meter, a poster, or a table card, and the destination is a lookalike payment page. Police departments and the FBI have warned about exactly this. A QR code gives the person scanning no clue about where it leads until after they've scanned it.

If you're the one printing the code, there are a few things you can do to make your own harder to abuse:

  • Print the destination as readable text under the code, so a swapped sticker doesn't match.
  • Use a domain you own and an HTTPS URL, not a third-party shortener.
  • Keep the path short and human-readable, so a person can tell example.com/menu from something strange.
  • For codes in public spaces, check them periodically. A cheap sticker takes seconds to place.

Generating One Without Handing Over the Payload

The QR code generator produces static codes for a URL, plain text, WiFi credentials, an email with a pre-filled subject and body, or a vCard. It escapes the WiFi and vCard special characters for you, exports PNG or SVG, and runs in your browser, so a WiFi password or a private link never reaches a server. It uses level M and adds a two-module border, which is tighter than the four the spec asks for, so leave generous white space around it when you print.

If you're building the redirect URL yourself, run the destination through the URL encoder first, particularly if it carries query parameters. And for the guest network, the password generator will give you something stronger than the name of the cafe.

Free Developer Tools

Put the knowledge to work.

50 browser-based tools. No account. No data sent to a server.