QR Art Make yours

Learn

How QR codes work

A QR code is a grid with a plan. Fixed patterns help a scanner find it and measure it, and the rest carries your content, together with spare data for repairs.

A grid of modules

The black and white squares are called modules. The grid is always square, and its size depends on the version: version 1 is 21 × 21 modules, each following version adds 4 modules per side, and version 40 is 177 × 177. If these terms are new to you, start with what a QR code is.

Finding the code: finder patterns

A camera sees a whole scene, so the first job is to find the code in it. For that, a QR code has three finder patterns: squares of 7 × 7 modules, each a dark ring around a light ring with a dark centre. They sit in three of the four corners.

The empty fourth corner is useful. Since the three squares form a shape with only one right way up, a scanner can tell how the code is turned, and you do not have to hold your phone straight. Each finder pattern is surrounded on its inner sides by a white separator, one module wide, so the pattern stands apart from the data next to it.

Measuring the grid: timing and alignment

Once the corners are found, the scanner needs to know where each module is. The timing patterns are two lines of alternating dark and light modules that run between the finder patterns, one across and one down. They work like the marks on a ruler and help count the rows and columns.

From version 2 upwards there are also alignment patterns: smaller squares placed inside the grid, with more of them in larger versions. A code is rarely seen perfectly flat and head-on. Extra reference points help the scanner correct for the distortion when the code is photographed at an angle or printed on a surface that is not flat.

The notes about the code itself

Some modules describe how the code was made. The format information records two choices: the error-correction level and the mask pattern. The scanner needs both before it can make sense of the data. From version 7 upwards, the code also carries version information, which states its size.

Error correction: Reed–Solomon codes

The content of a QR code is stored as a series of units called codewords. QR codes add further codewords, calculated from the content with Reed–Solomon codes. These are not simple copies. They are built so that, when some codewords are read wrongly or cannot be read at all, the original values can be worked out again from the ones that remain.

The creator of a code picks one of four levels:

Level Codewords it can recover (roughly)
L7%
M15%
Q25%
H30%

A higher level survives more damage but leaves less room for content, so the same link may need a larger version. Note that the percentages are about codewords. They do not promise that you can cover any 30% of the printed square: hiding a finder pattern, for example, can stop a scanner from finding the code at all.

Masking: breaking up large areas

Written out directly, some content would produce big blank patches or large dark blocks. Those are hard for a scanner, which relies on seeing changes between neighbouring modules to keep its place in the grid.

The solution is a mask. One of 8 mask patterns is applied to the data area: a fixed rule that flips certain modules from dark to light and from light to dark. The aim is a well mixed picture, so that scanners are not confused by large uniform areas. The format information says which of the 8 was used, so the scanner can flip the same modules back. The fixed patterns, such as the finders, are left as they are.

The quiet zone

Finally, the code needs space around it. The quiet zone is a light margin without any text or graphics, and a width of 4 modules is recommended. Without it, nearby shapes can look like part of the code.

Reading a code, step by step

  1. Find the three finder patterns, and from them the position and rotation of the code.
  2. Use the timing and alignment patterns to work out where every module sits.
  3. Read the format information to learn the error-correction level and the mask.
  4. Look at the centre of each module, decide whether it is dark or light, and undo the mask.
  5. Use Reed–Solomon error correction to repair mistakes, then turn the codewords back into the content.

Step 4 is the opening that artistic QR codes use. If the centre of a module has the right tone, there is room to show something else around it. See how QR art works.

Type a link into the editor and watch the grid size change as the link gets longer.

Try it

Contact the Maker

QR Art is made by Víg Réka, The WOW Studio. Got an idea for a tool, or want a custom QR for your brand? Message me.

Or copy the address: hello@rekavig.com

Nothing is sent from the site itself: the buttons open your own app. Privacy