All articles
Guides· 9 min read· Updated

How to generate a QR code for a website

Generating a QR code for a website takes about thirty seconds. Generating one that still works in six months, survives a print run on uncoated stock and tells you how many people actually scanned it takes a handful of extra decisions. This guide walks through the whole process the way a print shop or marketing team would run it: choosing the code type, generating and styling it, sizing it for the surface it will live on, testing it properly, and reading the scan data afterwards.

A working QR code for this article — scan it to open this page on your phone.

Key takeaways

  • Use a dynamic QR code for anything printed — the destination stays editable after the ink dries.
  • Keep the pattern dark on a light background with a quiet-zone margin of at least four modules.
  • Size the code at roughly one tenth of the intended scan distance: 10 cm for one metre, 30 cm for three metres.
  • Export SVG or a 300 DPI PNG relative to the final print size, never the screen size.
  • Test the final artwork at final size on both an iPhone and an Android device before the run.

Step 1: decide between a static and a dynamic QR code

This is the only decision in the process that you cannot reverse later, so it is worth two minutes of thought. A static QR code encodes your destination URL directly into the black-and-white pattern. Nothing sits between the scanner and the address: the phone reads the URL out of the ink and opens it. That makes static codes free forever and immune to any service shutting down, but it also means the destination is permanent. Change the URL, move the page, restructure the site, and every printed code becomes a dead end.

A dynamic QR code encodes a short link that you control — something like qrforge.biz/r/a7f2k9. When someone scans it, the short link resolves and forwards them to wherever you currently point it. You can change that destination at any time, pause the code, and record every single scan with a timestamp, device type and rough location.

The rule most print shops settle on: if the code is going onto anything physical — packaging, menus, posters, business cards, vehicle livery, product labels — make it dynamic. The moment a client asks for a URL change you avoid an entire reprint, which is usually worth more than the subscription that enabled it. Static codes remain perfectly sensible for a temporary on-screen code, a Wi-Fi password card, or a vCard where there is no destination to redirect to in the first place.

Static vs dynamic QR codes at a glance
StaticDynamic
Destination editable after printingNoYes
Scan tracking and analyticsNoYes
Pattern density for a long URLHigh (fragile at small sizes)Low (short link)
Works if the provider disappearsYesNo — depends on the redirect
Best forWi-Fi, vCard, plain textPrint, packaging, campaigns
Static vs dynamic QR codes at a glance

Step 2: generate the code and style it without breaking it

Paste the destination URL into your generator, choose the colours, and download. Styling is where most codes quietly become unreliable, because a design that looks striking on a monitor can be nearly unreadable to a camera under real lighting. Three constraints keep a styled code scannable.

Contrast comes first. Camera software thresholds the image into light and dark before it decodes anything, so what matters is luminance difference, not hue. A deep violet on a near-white background scans instantly; a mid-grey on beige does not, however tasteful it looks in the brand guide. Inverted codes — light modules on a dark field — are decoded by modern iOS and Android cameras but still defeat a meaningful share of older third-party scanner apps, so avoid them on anything mission-critical.

The quiet zone comes second. Every QR code needs an empty margin of at least four modules on all four sides. Designers routinely crop it to make a code sit tighter in a layout, and that single change is the most common cause of a code that scans on the desk but not in the wild.

Error correction comes third. Levels L, M, Q and H recover roughly 7%, 15%, 25% and 30% of a damaged code respectively. Higher levels add modules, making the pattern denser, so do not simply max it out. Use M for screens and clean print, and step up to Q or H only when you are placing a logo in the centre or printing onto a textured or absorbent substrate.

  • Keep strong luminance contrast between the pattern and its background — dark on light is the safe default.
  • Never crop the quiet zone; leave a clear margin of four modules or more.
  • Use error correction M for screens, Q or H with a centre logo or rough stock.
  • Keep any centre logo under about a fifth of the total code area.
  • Avoid gradients that fade the pattern towards the background luminance at the edges.

Step 3: size the code for the surface it will live on

The working rule across the industry is a 10:1 scan-distance ratio: the printed code should be roughly one tenth as wide as the distance it will be scanned from. A code read from one metre needs to be about 10 cm across. A poster read from three metres across a train platform needs about 30 cm — far larger than most layouts allow for, which is why so many outdoor codes go unscanned.

Close-range placements are more forgiving. A table tent scanned from 30–40 cm works comfortably at 3 cm square, with about 2 cm as the practical floor once you account for phone camera minimum focus distance. Business cards sit in the same range. Below roughly 15 mm, even a short dynamic link starts to struggle on anything but a premium coated stock.

For print output, export vector SVG or PDF whenever the workflow allows it, because module edges stay perfectly crisp at any scale. When you must use raster, export at 300 DPI relative to the final printed dimensions rather than the on-screen dimensions. A 200-pixel PNG stretched across a 30 cm poster produces soft, blurred module edges that camera autofocus cannot lock onto.

Recommended minimum code size by placement
PlacementTypical scan distanceMinimum code width
Business card, table tent30–40 cm2–3 cm
Product packaging, flyer40–60 cm3 cm
Window sticker, A4 poster1 m10 cm
Wall poster, trade-show panel2–3 m20–30 cm
Billboard, vehicle livery5 m+50 cm+
Recommended minimum code size by placement

Step 4: test before you commit to a print run

Scan the final artwork, at final size, on at least one iPhone and one Android handset, in lighting that resembles where the code will actually live. Restaurant lighting is warm and dim; a shop window is backlit and reflective; a train platform is fluorescent and grubby. Each of these changes how a camera sees your pattern.

For any run above a few hundred pieces, print a physical proof on the production stock and scan that. Ink spread on uncoated and recycled paper thickens the dark modules and thins the light gaps between them, which can push a marginal code over the edge into unreadable. Gloss stock introduces the opposite problem: specular highlights that blind the sensor at exactly the angle a seated guest holds their phone.

The overwhelming majority of failed QR campaigns trace back to a test that never happened — a code approved as a PDF on a designer's monitor and never scanned off a printed sheet.

  • Scan the final artwork at final trim size, not a zoomed preview.
  • Test on both iOS and Android, plus one older device if your audience skews that way.
  • Test in the real lighting conditions, including glare on gloss stock.
  • Confirm the destination returns a working page, not a staging redirect or a 404.
  • Check the page is mobile-first — every scan arrives on a phone, by definition.

Step 5: measure the scans and act on them

A dynamic code turns a printed asset into a measurable channel. Each scan records a timestamp, device type, operating system, browser, country and city where available, and a referrer when one exists. Aggregated, that tells you which poster location earned attention, which table in the room turns over fastest, and whether the flyer batch handed out at an event did anything at all.

Use one distinct code per placement rather than one code across a whole campaign. The extra minute of setup is what makes comparison possible: poster A versus poster B, terrace versus bar, print run one versus print run two. Without that separation you have a single number that proves nothing.

Finally, treat scans as an intermediate metric, not the goal. The number that matters is scan-to-conversion — how many people who scanned went on to book, order, sign up or buy. A code with 4,000 scans and no conversions is telling you the placement works and the offer behind it does not, which is a far more useful finding than the scan count alone.

Frequently asked questions

Do QR codes expire?

The pattern itself never expires — it is just encoded data. A static code works as long as its destination URL works. A dynamic code works as long as the redirect service behind it is running and the code is active, which is why it is worth choosing a provider you expect to keep paying for.

Can I change where a QR code points after it is printed?

Only with a dynamic QR code. A dynamic code encodes a short link, so you edit the destination in your dashboard and every printed code immediately forwards to the new page. A static code has the destination baked into the pattern and cannot be changed.

What is the smallest a QR code can be?

About 2 cm square for close-range scanning at 30–40 cm, assuming a short dynamic link and clean print. Below roughly 15 mm the modules become too fine for reliable camera autofocus on most phones.

Do coloured QR codes still scan?

Yes, provided there is a strong luminance difference between the pattern and the background. Scanners threshold the image into light and dark before decoding, so a dark colour on a light background works well while two mid-tones of similar brightness will fail.

Do I need an app to scan a QR code?

No. The native camera apps on iOS and Android have decoded QR codes automatically for years. Dedicated scanner apps are only relevant for older devices, and those are the ones most likely to reject inverted or low-contrast designs.

Generate a dynamic QR code in under a minute

Branded design studio, editable destinations and real-time scan analytics in one workspace.

Start free

Keep reading