QR codes went from a niche Japanese manufacturing tool to something scanned billions of times a day on restaurant menus, payment screens and posters, especially since phone cameras started reading them natively without a separate app. The pattern of black-and-white squares looks arbitrary, but every part of it is doing specific work.
Why QR codes replaced barcodes for a lot of uses
A traditional barcode is one-dimensional — a series of parallel lines that only encode data along a single horizontal axis, which caps how much information it can hold (usually just a short numeric product code). A QR code is two-dimensional, encoding data both horizontally and vertically across a grid, which lets it hold vastly more information — a QR code can comfortably store a full URL, a couple of paragraphs of text, or structured contact information, not just a short numeric string.
The three squares that make scanning instant
Look closely at any QR code and you'll notice three large square patterns in three of the four corners (never all four — that asymmetry itself is meaningful). These are position detection patterns, and they're the reason your phone can lock onto a QR code and read it correctly no matter what angle you're holding it at, or whether the image is upside down, rotated, or skewed. The scanner's software looks for that specific nested-square shape first, uses the three corners to figure out the code's orientation and boundaries, and only then starts reading the actual data inside the grid.
Built-in error correction: why damaged codes still scan
QR codes use a mathematical error correction scheme (Reed-Solomon codes) that deliberately stores redundant data across the grid — meaning the code can still be read correctly even if a meaningful chunk of it is smudged, torn, or deliberately covered with a small logo, which is exactly why so many QR codes have a company logo sitting in the middle without breaking the scan. There are four standard error correction levels, trading off how much damage the code can tolerate against how much of the grid gets used for redundancy instead of actual data — higher error correction means a code can survive more damage, but it also means less of the available space carries your actual content, so the code needs to be physically larger to hold the same amount of information.
What's actually stored inside
People often assume a QR code stores a whole web page or file, but it almost always just stores a small piece of text — most commonly a URL, but also plain text, a phone number formatted for auto-dialing, a Wi-Fi network name and password, or a vCard-format contact card. Any actual content the QR points to (a webpage, a video, a menu) lives elsewhere; the code itself is just the compact, reliably-scannable pointer to it.
Why bigger isn't always better
More data packed into a QR code means a denser grid — smaller, more tightly packed squares — which makes it harder for a camera to read from a distance or under poor lighting. This is why long URLs sometimes produce oddly dense, hard-to-scan QR codes, and why shortening a URL before generating a code for print materials (posters, product packaging, anything meant to be scanned from a few feet away) is usually a good idea.
The four ways a QR code can store data
QR codes don't encode every kind of content the same way internally — the standard defines four main encoding modes, and the generator picks the most efficient one automatically based on what you're storing. Numeric mode handles digits only, and is the most space-efficient, packing three digits into roughly 10 bits. Alphanumeric mode extends this to uppercase letters, digits and a small set of symbols, useful for things like flight booking references. Byte mode is the most flexible, handling any raw byte sequence — including lowercase text, full URLs, and non-Latin scripts through UTF-8 — but at a lower data density than the numeric or alphanumeric modes. Kanji mode is a specialized, more compact encoding specifically for Japanese Kanji and Shift-JIS text, reflecting the format's origins. A URL with lowercase letters, which is the most common real-world use, ends up in the least space-efficient byte mode — one more reason a long, lowercase-heavy URL produces a denser, harder-to-scan code than a shorter, mixed-case-and-numeric one would.
Where QR codes actually came from
QR codes were invented in 1994 by Masahiro Hara, an engineer at the Japanese company Denso Wave, a subsidiary of Toyota. The original problem had nothing to do with restaurant menus or payments — it was inventory tracking on automotive assembly lines, where traditional one-dimensional barcodes simply couldn't hold enough data to track the growing number of parts and components efficiently, and workers needed something that could be scanned quickly from any angle on a fast-moving production line. Denso Wave deliberately chose not to enforce its patent rights over the core QR code standard, which is a big part of why the format was free for anyone to adopt and implement without licensing fees — a decision that, three decades later, turned a factory-floor inventory tool into one of the most-used pieces of visual technology in the world.
Try it yourself
Our QR Code Generator creates a scannable code from any text or URL instantly, entirely in your browser, with no data sent to a server in the process.
Related reading
- What Is a UUID, and Why Does Almost Every App Use One? — a different kind of compact, machine-generated identifier, solving a related but distinct problem.
- How to Create a Strong, Unbreakable Password in 2026 — if you're generating a QR code for Wi-Fi sharing, this covers what makes the password inside it actually secure.