Home / Guides / How QR Codes Work and How to Make One That Scans Reliably
Free guide · Doc Writer Lab

How QR Codes Work and How to Make One That Scans Reliably

A plain-English look at what is inside a QR code, plus size, contrast and testing advice for codes that scan the first time.

Explore free tools →

A QR code is just text drawn as a pattern

A QR code looks mysterious, but it does one plain thing: it stores a short piece of text as a grid of dark and light squares, called modules. Your phone camera reads the grid, turns it back into text, and then decides what to do with that text. If the text looks like a web address, it offers to open the page. If it looks like a Wi-Fi login, it offers to join the network. The code itself contains no internet connection and no app, only the text.

That is why a QR code can fail in two different ways. Either the camera cannot read the pattern, or it reads it perfectly and the text is wrong. Most scanning problems come from one of those two, and both are avoidable.

What is inside the square

The corner squares and the quiet zone

Three large squares in the corners tell the scanner where the code is, which way it is rotated and how big it is. That is why a code still scans when it is upside down or viewed at an angle. Around the whole pattern there should be a plain margin, often called the quiet zone, of about four modules. Without it the scanner cannot tell where the code ends and the background begins.

The data and the repair information

The rest of the grid holds your text plus extra repair data. QR codes use error correction, which means a code can often still be read after a small part is smudged or covered. There are four levels, commonly labelled L, M, Q and H, which recover roughly 7, 15, 25 and 30 percent of damage. The generators on this site use level M. Higher levels survive more damage but need more modules, which makes each module smaller on a printed code of the same size.

Why longer text makes a denser code

The more text you encode, the more modules are needed, and the smaller each one is at a given print size. Smaller modules are harder to read from a distance or on a cheap camera. A short link makes a calm, open pattern and a very long link with tracking parameters makes a crowded one. If you have a choice, encode the shorter address.

Static codes: what you get here

The codes made on this site are static. The text is baked into the picture, so the code works for as long as the destination exists, and it can never be edited afterwards. If you print 500 flyers and then move the page, those flyers will point to the old address. There is no hidden redirect service in between, and equally no tracking, no scan statistics and no way to change the destination later. Some commercial services sell dynamic codes that route through their own server; those can be changed, but they stop working if you stop paying, so for anything printed and permanent a static code to an address you control is the safer design.

The generator creates the image in your browser using a small open-source library and offers it as a PNG download. The page limits content to 2,800 characters, which is far more than any normal link needs.

Step by step: making a code that scans reliably

  1. Pick the right type. On the QR code generators page, choose the type that matches your goal: a plain website link, Wi-Fi network, contact card, and so on. The type decides how your input is wrapped. A Wi-Fi code, for instance, is stored in a specific format that phones recognise.
  2. Copy the destination exactly. For links, copy the address from the browser bar and include the https:// start. Without it, some scanners show the address as text rather than offering to open it.
  3. Trim the link. Remove tracking parameters you do not need. Shorter means simpler.
  4. Generate and test immediately. Scan the preview with your own phone before you download anything.
  5. Download the PNG. The preview is 240 pixels wide, which suits screens and small prints. For large posters, test a printed copy at full size before ordering a big run.
  6. Place it with care. Keep the quiet zone clear, do not stretch the image unevenly, and do not put it over a busy photo.
  7. Test the printed result. Try two or three different phones in the real lighting where people will scan.

Colour, size and placement

The generator uses very dark modules on a white background, and that is the combination scanners handle best. If you recolour a code yourself, keep strong contrast and keep the dark colour on the modules. Inverted codes, light modules on a dark background, are not read by every scanner. Pale colours on white, or a code placed over a gradient, are the most common causes of codes that scan on a screen but fail in print.

For size, a useful rule of thumb is about one centimetre of code width for every ten centimetres of scanning distance. A code on a shop window that people read from two metres away should be at least a couple of centimetres wide, and bigger is kinder. On a business card, a 2 to 3 centimetre code is generally comfortable. Treat these as starting points and confirm with a real test.

Avoid placing a code on a curved or reflective surface, on a crease in packaging, or in a spot hidden by a glossy finish that glares under shop lights. Matte stock scans more reliably than high-gloss.

Checking what you encode

Because a QR code is only text, the safest habit is to treat it like a link someone has handed you. Before printing, read back the exact text. After scanning, look at the address your phone shows before you tap it. On public posters, check that nobody has stuck another code over yours, which is a known trick. And never put anything private in a code, such as a password reset link, a private document link or a payment detail you would not want a stranger to have, because anyone who scans gets exactly what is in it.

Wi-Fi codes are a good example. They include the network password in readable form to any phone that scans them. They are convenient for a guest network and a poor idea for your main one if the printed code sits where visitors can photograph it.

Common reasons a code will not scan

  • Too small or too far. Enlarge it or move closer.
  • No quiet zone. Crop margins or text touching the pattern confuse scanners.
  • Low contrast. Pale colours, patterned backgrounds, glare.
  • Too much data. Shorten the link.
  • Stretched image. Resize with the aspect ratio locked.
  • Wrong text. The code scans but opens the wrong page, usually from a typo or a missing https://.
  • Blurry export. Scaling a small PNG up in a design tool softens the edges. Place it at its natural size or regenerate at the size you need.

What this approach cannot do

  • It cannot change the destination after printing.
  • It cannot tell you how many people scanned the code.
  • It cannot guarantee that every payment app will accept a payment code. Compatibility depends on the bank or provider, so use the exact payload your provider gave you and test it.
  • It does not create vector files for large-format print. A PNG is fine for screens and small prints, but for billboards a vector export from design software is better.

Frequently asked questions

Do QR codes expire?

A static code never expires by itself. It stops being useful only when the thing it points to disappears.

Is my link sent to your server?

The image is generated in your browser, so the link does not need to be uploaded to produce the code. The page you link to has its own rules and its own analytics, if any.

Can I put a logo in the middle?

This generator does not add logos. Covering part of a code relies on the repair data and reduces your safety margin, so if you add one elsewhere, test thoroughly.

Why does my code look different from my friend's?

Different text, a different amount of text or a different error-correction level changes the pattern. All of them can be valid.