QR Codes

QR code exampleQR code example.

This article has an interactive part, see the DIY section.

You are probably familiar with images like the one on the right, which shows a QR code (QR is short for Quick Response). These codes are becoming more and more common, and can be found on business cards, ads, historical buildings, T-shirts, etc. You're meant to scan them using your smartphone (I use Barcode Scanner on an Android phone). They can contain all sorts of information, the most common being plain text, URLs, and contact information (e.g., in the form of a vCard). The information is in the code itself, the code is not a link into some vast database on the internet or something.

QR codes are an example of so-called matrix barcodes, which are a two dimensional alternative to the well-known “striped” barcodes. The example encodes the URL for this website. Because they are two dimensional, QR codes have a higher information density than traditional barcodes, which means that they can store more information on a given surface area.


QR code structureQR code structure.

Apart from the seemingly “random” pixels, which encode the actual information, each code has a number of fixed elements. The example QR code is shown again on the right, with the important structural elements highlighted in different colors.

The three large indicators in red tell the scanner what the basic position of the QR code is. The three indicators together form a right-angled triangle. The scanner can use this information to determine the exact orientation of the QR code, even when the code is not scanned from a perpendicular angle. The smaller indicator in blue enables the scanner to align the image further. There is only one alignment indicator in this small QR code, but there are more in larger ones. You could easily miss the lines of alternating black and white pixels that are highlighted in yellow. These lines form a coordinate reference to determine the location of the rest of the symbols. Finally, the area highlighted in green must be kept empty, to avoid confusing the scanner.

The final building block of QR codes is the error correction mechanism, using the nifty Reed-Solomon encoding. Explaining Reed-Solomon error correction would require a separate article, I'll just mention here that this technique is really used a lot, for example on CDs and for satellite communications.


An easy way to create your own QR codes is using the Google Infographics service. The QR code in the example above can be generated by typing the following in the URL bar of your browser.


Note that the parameters are URL encoded (for example, each slash has been replaced by %2F).

The form below allows you to create your very own QR codes! Try it!

QR Code



Add new comment

The content of this field is kept private and will not be shown publicly.
Spam avoidance measure, sorry for this.

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.
Submitted on 25 October 2011