Every dayEveryday Use

QR Code
generator.

A QR code holds your link or WiFi login in its pattern, with no server in between.

How it's worked out

Your content is first turned into a plain line of text in the format a phone camera expects. A web address needs its https:// prefix, a phone number becomes a tel: link, and an email becomes a mailto: link. That line is all the code holds, and a phone camera offers to act on it, for example by joining the network in a WiFi code.

  • Web link: https://example.com
  • Phone: tel:+15550100199
  • Email: mailto:name@example.com?subject=Hello
  • Text message: SMSTO:+15550100199:Your message
  • WiFi: WIFI:T:WPA;S:network;P:password;;

The encoder then picks the smallest size that holds the text at your chosen level of error correction. Sizes are called versions, and each one is a square grid of modules, the small dark and light squares. The three large squares in the corners let a camera find and straighten the code. Reed-Solomon error correction is what lets part of it be damaged and still read.

modules per side\displaystyle \text{modules per side}=17+4v\displaystyle {}= 17 + 4v

Here v is the version, from 1 to 40. Denso Wave, which announced the format in 1994 (it is now the ISO/IEC 18004 standard), gives 21 modules a side for version 1 and 177 modules for version 40. More text or more error correction pushes the code to a higher version, so the modules get smaller at the same printed size.

printed width\displaystyle \text{printed width}=(modules+2×4)×module size\displaystyle {}= (\text{modules} + 2 \times 4) \times \text{module size}

The extra 4 on each side is the quiet zone, a clear margin that Denso Wave says every QR Code requires.

Worked examples

A table card for a cafe menu

The owner types www.example.com/menu and the code stores https://www.example.com/menu. At level M that is 28 bytes in a version 3 code, 29 modules a side.

The same link at each error correction level
LevelBuilt to surviveVersionModules a side
Labout 7%225
Mabout 15%329
Qabout 25%329
Habout 30%433

She has 30 mm on the card, margin included, which makes each module 0.81 mm. A common laser printer can reach about 0.17 mm a module, so this code could print as small as 6.29 mm, but a phone at arm's length may not read one that tiny. She tests a printed card before ordering 200.

Open this example in the tool

A guest WiFi code with a tricky password

The network is Harbor Cafe and the password is Back\room:2026. Both the backslash and the colon mean something in the WiFi format, so each one gets a backslash in front. The stored text becomes WIFI:T:WPA;S:Harbor Cafe;P:Back\\room\:2026;;.

That is 45 bytes and a version 4 code at level M. The password sits in the code as plain text, so anyone who scans it can read it. Print this one for a guest network and not your main network.

A long campaign link against a short one

A flyer printed at 25 mm with level Q has a choice. The full tracking link is 115 bytes, which needs version 9 and modules of 0.41 mm. A short address on the same site is 21 bytes, version 3 and modules of 0.68 mm.

That is modules 1.6 times as wide at the same print size, and wider modules are easier for a camera. Point a short path on your own site at the long link, and you can also change the destination later without reprinting.

Open this example in the tool

Reading your result

Pick the level for the conditions. Denso Wave says level M is the one most often chosen, with Q or H for dirty places such as factories and L for clean places with a lot of data. Higher levels mean a bigger, denser code.

The most plain text one code can hold
LevelBuilt to surviveBytes
Labout 7%2,953
Mabout 15%2,331
Qabout 25%1,663
Habout 30%1,273

A byte is not always a character. Plain English letters take one byte each, while accented letters and many other scripts take two or more. The figure of 2,331 at level M is the limit, and a code that full is far too dense to print small.

Check the size against the distance. Denso Wave's worked example is a version 3 code at 0.254 mm a module, which is 7.37 mm wide and 9.4 mm with its margin. That suits a scanner held close and not a poster across a room. We found no primary source for a size-to-distance rule, so test yours at the real distance.

Static means no one in the middle. These codes hold the content itself, so no service is called when someone scans, and there is no account to lapse. The cost is that you cannot count scans, and you cannot change the content of a printed code.

Common mistakes

  • Cropping the margin. Designers often trim the white space to fit a layout. Denso Wave asks for 4 clear modules on all four sides, and a dark edge up against the pattern can stop a scan.
  • Reversing the colors or using pale ones. Denso Wave advises printing black on white. Colored codes can scan, depending on the pair of colors, but test them first.
  • Covering part of the code with a logo. That spends the error correction on damage you made on purpose. Denso Wave warns that a code changed this way is relying on that function, and asks you to consult it before adding a design.
  • Printing a link you do not control. The code will keep pointing at the address even after the page is gone. Use an address on your own site that you can keep alive.
  • Putting codes where someone can cover them. The FTC reports scammers placing their own codes over the ones on parking meters. Print your web address beside the code so people can check where it goes.

Questions people ask

A static code cannot expire, because it holds the content in its own pattern. What can fail is the page it points to, or the print if it wears down. Dynamic codes are different: they hold a short link run by a service, so they depend on that service and your plan with it. The codes made here are all static.

Sources