But how does a smartphone — or any bar code scanner, for that matter — actually make sense of the seemingly unintelligible patterns of lines and squares that 2D bar codes contain? Part of the answer lies in the bar code itself, which is designed to make the scanning process as accurate and speedy as possible.
Alignment and Data
Every QR Code contains a finder pattern: an arrangement of squares that helps the QR scanner detect the size of the QR Code, the direction it's facing and even the angle at which the code is being scanned.
Next, every QR Code contains an alignment pattern, which is another pattern of squares designed to help a QR reader determine if the 2D bar code is distorted (perhaps it's placed on a round surface, for instance).
Once the smartphone's camera processes the code's image, the software goes to work analyzing the image. By calculating the ratio between the black and white areas of the QR Code image, it can quickly identify which squares are part of the alignment patterns and which squares contain actual data.
Allowing for Imperfection
Of course, QR Code scanning has a margin for error. Even if part of the pattern is smudged or obscured, you can still scan QR Codes with a QR Code reader.
Using built-in patterns and error correction of the QR Code system, the software can also compensate for any distortion or obscured areas of the bar code. After the software has digitally "reconstructed" the QR Code, it examines the jumble of black and white squares in the QR Code's data section and outputs the data contained within.
How to Create QR Codes
You can make your own 2D bar code using QR Code generators online. They let you generate QR codes and adjust everything from the format you want to use to the size of the code.
So the next time you're putting up a flyer for your local garage sale, consider using a QR Code generator to add a code with the sale details. Who knows how many smartphone-carrying bargain hunters you might attract?
On the flip side, you don't want to accidentally scan a malicious QR Code created to steal data stored on your device. Certain apps and scanners will check to make sure you're only able to open legitimate QR Codes, providing a comforting level of added security.