Short answer: a QR code is a grid of black and white squares that stores a short piece of data, usually text or a web address. When your phone’s camera scans it, software locates the code, works out its orientation, reads the squares as ones and zeros, corrects any errors, and turns the result back into text. Your phone then decides what to do with that text: open a link, join a Wi-Fi network, or save a contact.
The code itself doesn’t “go” anywhere or run anything. It’s just data written in a pattern a camera can read. This guide walks through that process step by step, explains why scratched or crooked codes often still work, and covers what to watch out for.
What a QR code actually contains
QR stands for “Quick Response.” The code was created in 1994 by Denso Wave, a Japanese company, originally to label automobile parts. It’s a two-dimensional matrix barcode, which means information is stored both horizontally and vertically, unlike a traditional barcode, which only varies in one direction.
Each small black or white square is called a module. A module is one bit of information. Together, the modules encode:
- your data (a URL, text, a phone number)
- extra error-correction data
- a few fixed patterns that help the scanner find its way around
Everything you see in the code is one of those three things.
What your phone does when you scan: step by step
1. The camera captures the image
Your camera takes a picture of the code, usually continuously, frame after frame. Scanning feels instant because the software is reading a live video feed and stops as soon as one frame decodes successfully.
2. The software finds the three big squares
Look at any QR code and you’ll see three large square “bullseyes” in three corners. These are finder patterns. They have a distinctive ratio of black and white, so software can spot them quickly even in a cluttered photo.
The missing fourth corner is useful too. With three corners located, the scanner knows where the code starts, which way is up, and roughly how large it is, so you can scan it sideways or upside down.
3. It corrects for tilt and distortion
Codes on curved bottles or viewed at an angle look warped. Larger QR codes contain smaller alignment patterns, which help the software correct for distortion. A pair of timing patterns, alternating black and white lines running between the finder patterns, tells the scanner how big each module is so it can sample the grid accurately.
4. It reads the format information
Narrow strips near the finder patterns hold format information: which error-correction level the code uses and which mask was applied (more on both below). This information is stored twice, so the code can still be read when one copy is damaged.
5. It removes the mask
When a code is generated, the encoder tries several mask patterns, which flip certain modules from black to white and vice versa. This isn’t for secrecy. It avoids large solid blocks and awkward patterns that confuse scanners. The encoder picks the mask that produces the most readable result and records the choice. The scanner reads that choice and reverses it.
6. It reads the data and fixes errors
Now the scanner reads the modules in a set order and groups them into 8-bit chunks called codewords. Some carry your data, and others carry error-correction codewords, generated using a mathematical method called Reed–Solomon coding. If some modules were misread because of a smudge, glare, or damage, the extra codewords let the scanner work out what the missing values should have been.
7. It converts the bits back into text
The data is stored using one of several modes, such as numbers only, letters and numbers, or general bytes. Using the most compact mode for the content keeps the code small. The scanner decodes the bits into plain text.
8. Your phone decides what the text means
This step happens after the QR code part is finished. The scanner only produced text. Your phone’s camera app or scanner then interprets it:
- Text starting with a web address usually shows a link you can tap to open.
- Text in a recognized Wi-Fi format offers to join the network.
- A contact format offers to save the contact.
- Anything else is shown as plain text.
This distinction matters for safety, as you’ll see below. Reading the code doesn’t open a website by itself. What happens next depends on your phone and what you tap.
Why damaged QR codes often still scan
QR codes include four selectable error-correction levels, labeled L, M, Q, and H. Higher levels reserve more of the code for correction data, so they can recover from more damage. At the highest level, a code can be read even with up to roughly 30% of it damaged.
Two caveats:
- Higher correction means a denser code. The same data needs more modules, so each one is smaller and harder for a distant or low-quality camera to read.
- Damage isn’t just a percentage. A smudge covering a finder pattern, or too much damage concentrated in one block of data, can ruin a code even when most of it looks fine.
Error correction is also what lets designers place a small logo in the middle of some codes. The logo effectively “damages” part of the code, and the correction data covers for it. It works only within limits, so test every code with more than one phone before printing it.
Why a QR code needs empty space around it
Standard QR codes need a blank margin around them called the quiet zone. Without it, the scanner can’t tell where the code ends and the background begins. If you put a code on a busy photo or crowd it against a border, it may refuse to scan even though the code itself is perfect.
Does scanning a QR code need the internet?
Not to decode it. The reading and decoding all happen on your phone, offline. You only need a connection if the content is a web address and you choose to open it. A QR code containing plain text or a contact card works with no signal.
Static vs. dynamic QR codes
You’ll hear both terms. They describe how the code is used, not a different kind of pattern.
| Static QR code | Dynamic QR code | |
|---|---|---|
| What’s stored in the code | The actual content (a URL, text, etc.) | A short redirect link |
| Can you change the destination later? | No. You’d need a new code. | Yes, by editing where the redirect points |
| Depends on a service staying online? | No | Yes. If the redirect service stops, the code breaks. |
| Usually trackable? | Not by itself | Often, because scans pass through the redirect |
A static code is permanent and self-contained, which suits things like a link to your own website or a Wi-Fi password. A dynamic code makes sense for printed material you can’t easily replace, if you trust the service that hosts the redirect.
Are QR codes safe to scan?
A QR code isn’t a program and can’t do anything on its own. The risk is where it points you. The U.S. Federal Trade Commission has warned about scammers placing fake QR code stickers over real ones (for example, on parking meters) and sending unexpected QR codes by text or email to push people into scanning without thinking. The destination can be a fake site designed to collect personal information, or one that tries to install malware.
Sensible habits:
- Check the link preview your phone shows before you tap it, and look for misspellings or unfamiliar domains.
- Be wary of codes in unexpected places, especially stickers that look added on top of something else.
- Don’t scan unexpected codes in texts or emails that create urgency (“your package couldn’t be delivered”).
- For payments and logins, consider going to the official site or app directly instead.
- Keep your phone’s software up to date.
None of this means QR codes are dangerous in general. Treat them the way you’d treat any link: trust depends on the source.
Make your own QR code: what to get right
If you’re creating a code for a menu, flyer, or business card, a few choices decide whether it scans reliably:
- Keep the content short. A shorter web address creates a simpler code with larger modules.
- Use strong contrast. Dark modules on a light background is the safest choice.
- Leave the quiet zone around the code.
- Size it for the scanning distance. A code on a poster needs to be much larger than one on a business card.
- Test before you print. Scan it with at least two different phones, in normal lighting.
You can create and download a code with the [QR Code Generator](https://[QR Code Generator URL]) and run through those checks before it goes anywhere public.
Frequently asked questions
Can a QR code stop working?
A static code never expires, since the content is stored in the pattern itself. It can stop being useful if the web page it points to is removed. A dynamic code can also stop working if the service that handles its redirect shuts down.
Can I scan a QR code with any phone?
Most modern phones can scan codes directly from the built-in camera app. Older devices may need a separate scanner app.
Why won’t my QR code scan?
Common causes are low contrast, a missing quiet zone, a code that’s too small, too much data crammed in, heavy logo overlays, or a damaged print. Try a larger size, simpler content, or higher contrast.
How much data can a QR code hold?
It depends on the version (size) of the code and the data type. Numbers fit most compactly, then letters and numbers, then general text. Larger versions with lower error correction hold the most. For everyday use like URLs, capacity is rarely the issue. Shorter content is easier to scan.
Is the QR code technology free to use?
Denso Wave holds patent rights, but it published the specification and chose not to enforce those rights for standard QR codes, so anyone can generate and use them.
The takeaway
A QR code is a tidy package of data with built-in navigation aids and error correction. Your phone finds the corners, straightens the grid, reads the bits, repairs any damage, and hands you the text, and then it’s up to you to decide whether to trust where that text leads. If you make codes yourself, keep them simple, high-contrast, and tested.