Definition
A QR code is a pattern of black and white squares in a grid that stores information, such as text or a web address, in two dimensions. It can be read in an instant and holds far more data than the old barcode, which is read along a single horizontal line.
Why is it so much smarter than a regular barcode?
You've probably seen the striped barcodes that beep at the grocery store checkout. A traditional barcode shows numbers only through the thickness and spacing of lines running sideways. Since it writes along just one line, it could hold only about 20 characters.
A QR code, on the other hand, is a checkerboard grid that uses both width and height. It splits information into black and white dots across the whole flat surface. So even on a small piece of paper, it can comfortably hold thousands of characters, or a long website address.
Thanks to that, you no longer have to type a long web address into your phone one letter at a time. Just hold your camera up, and you can jump to a web page or a payment screen right on the spot.
The secret to reading torn or crumpled codes
Even when a café receipt with a QR code gets crumpled, or the corner of a poster is torn, the code still scans surprisingly well. That's because a QR code holds not just the original data but also math-based repair information that fills in the damaged parts.
This is called error correction. It works a bit like writing the key sentence of an important letter a second time, small, in the corner. Depending on the correction level chosen when the code is made, the original content can be recovered even if about 7% up to 30% of the data is damaged or erased.
This is also why you can put a cute character or a company logo right in the middle of a QR code. Even if the picture covers part of the data, the code works out the missing area from the surrounding tiles and fills it in by itself.
To be more precise
Look closely at the three corners of a QR code and you'll see three big square boxes. They are called "position detection patterns." Even if your phone camera sees the code at an angle or upside down, these give it reference points so the camera can figure out the code's exact direction and tilt in a second.
Once the boxes set the orientation, the code turns the layout of black and white tiles into the digital signals 0 and 1, the basic language of computers. Black dots become 1 and white dots become 0, and the camera sweeps quickly across the grid.
However, a QR code has a weakness too: with the naked eye, it's hard to tell whether it leads to a safe site or a dangerous one. Scams known as "Qshing" have appeared, where a fake code is stuck over a real one to steer people to a dangerous site. So be careful when scanning a code on a street sticker from an unknown source.
Common misconceptions
A QR code can't be read at all once it gets even a little scratched or has a corner torn.
Error correction is built in, so depending on the correction level, a QR code can be recovered and read even if about 7% up to 30% of its data is damaged or covered with scribbles.
Where you meet it
You scan the code on a restaurant table with your phone camera to see the menu and place an order.
You hold a plane boarding pass or a concert mobile ticket up to a gate reader and get in quickly.
In one sentence
It's a smart mosaic code that stores information in a two-dimensional grid, reads fast, and repairs itself when part of it is damaged.