How Do QR Codes Work? A Simple Guide From Squares to Scan

How do QR codes work: a woman scans an event ticket QR code with her smartphone camera

A QR code is a square, two dimensional barcode that stores data in a grid of black and white squares called modules, where dark means 1 and light means 0. Your phone finds the three big corner squares, reads the grid as binary, repairs damage with built in error correction, and turns it back into text, a link, or Wi-Fi details.

Introduction

I scan QR codes almost every day. Menus, parcel labels, payment counters, Wi-Fi cards, event tickets. For years I treated them like magic stickers: point the camera, wait half a second, done.

Then I started building and testing online converter tools, and I had to understand what actually sits inside that little square. It turned out to be one of the smartest pieces of everyday engineering I have studied.

In this guide I will answer how do QR codes work properly, from the first black square to the moment a link opens on your screen. I will keep it simple, but I will not skip the parts most articles leave out: how a QR code stores data bit by bit, why a torn code still scans, and how much one square can really hold. You will also learn how to make a QR code for a link or a website, which mistakes break a code, and how to avoid QR scams.

Where You Already Use QR Codes Every Day

Before the technical side, it helps to notice how often these codes quietly work for you.

  • Shopping: Many stores print a code next to the price tag for product details or a sale. If you like to calculate discount percentage before you buy, that scan often shows the original and sale price side by side.
  • Payments: In Pakistan, India, China and many other countries, you pay at small shops by scanning with a banking or wallet app.
  • Charity: Mosques and welfare trusts now display codes so people can give quickly. If you are working out how to calculate zakat for the year, there is a good chance you will pay it through a scan.
  • Travel and events: Boarding passes and concert tickets get scanned at the gate.
  • Wi-Fi sharing: One scan connects a guest without typing a long password.

Every one of these runs on the same system. So let us start at the beginning.

What Is a QR Code?

A QR code is a two dimensional (2D) matrix barcode that stores information both horizontally and vertically, so it holds far more data than a regular barcode. QR stands for “Quick Response,” because it was designed to be read very fast.

If you have ever wondered what is a QR code compared with the striped barcode on a cereal box, here is the short version. A normal barcode stores data in one direction only, left to right. A QR code uses a grid, so it stores data in two directions at once. That single change lets it hold thousands of characters instead of about 20.

A short history

The format was created in 1994 by Denso Wave, then part of the Denso group, a major Toyota supplier in Japan. Engineer Masahiro Hara led a very small team. Factory workers tracking car parts had to scan several barcodes per box, which was slow. They needed a code that held more data, including Japanese Kanji and Kana, and could be read at high speed from any angle.

According to the official QR code history published by Denso Wave, the company kept its patent but chose not to enforce it, so anyone could use the format for free. I think that decision is the real reason these codes are everywhere today. No license fee meant every phone maker, app developer and printer could adopt it.

The format is now an international standard called ISO/IEC 18004. The latest edition of the QR code specification was published in 2024, and it defines exactly how every module, pattern and bit must be laid out.

How Do QR Codes Work? The Big Picture

QR codes work by turning information into binary (1s and 0s), adding error correction data, and drawing all those bits as dark and light squares on a grid that a camera can read from any angle.

The full journey looks like this:

  1. You give the encoder some data, like a web address.
  2. It picks the most compact way to turn that data into bits.
  3. It adds error correction bits so the code survives damage.
  4. It places the bits on a square grid in a fixed zigzag order.
  5. It applies a mask so cameras can read the pattern easily.
  6. Fixed patterns in the corners and edges help scanners find and align it.
  7. Your phone reverses the whole process and shows the original data.

The rest of this guide zooms into each step, because the clever details are what make the system so reliable.

The Anatomy of a QR Code

To really see how do QR codes work, look closely at any code. It is not random noise. Some parts are always the same, and those fixed parts make fast scanning possible.

Finder patterns (the three big squares)

The large squares in the top left, top right and bottom left corners are finder patterns. Each is a dark square inside a light ring inside a dark ring.

A line drawn through the middle of one shows dark, light, dark, light, dark in a ratio of 1:1:3:1:1. That ratio rarely appears by accident, so a camera can spot the code instantly even in a messy photo. Because the fourth corner has no finder, the scanner also knows which way up the code is. That is why you can scan one upside down or sideways.

Alignment patterns

Larger codes have one or more smaller squares, usually near the bottom right. These alignment patterns help correct distortion when the code sits on a curved bottle or is photographed at an angle. The smallest size, version 1, has none.

Timing patterns

A row and a column of alternating dark and light modules run between the finders. These timing patterns work like a ruler, telling the scanner how big each module is and where every row and column sits.

Quiet zone

The empty border is the quiet zone. The standard asks for a margin at least four modules wide. Without it, the scanner can confuse the code with nearby text. This is one of the most common reasons a printed code fails.

Format and version information

Small strips next to the finders store format information: the error correction level and the mask pattern used. It is stored twice, so it survives damage. Version 7 and above also store version information about the grid size.

The data area

Everything else holds your actual message, mixed with the repair data that lets it survive scratches and stains.

How a QR Code Stores Data, Step by Step

This is the part most guides skip, and it is the most interesting. Here is how a QR code stores data, using the text HELLO WORLD as an example.

Step 1: Choose an encoding mode

There are four main modes, and the encoder picks the most efficient one for your content.

ModeWhat it storesHow it packs data
NumericDigits 0 to 9 only3 digits in 10 bits
Alphanumeric0 to 9, A to Z (uppercase), space and $ % * + – . / :2 characters in 11 bits
ByteAny text, including lowercase, symbols and UTF-88 bits per byte
KanjiJapanese Kanji and Kana1 character in 13 bits

HELLO WORLD uses only uppercase letters and a space, so the encoder chooses alphanumeric mode. Typed in lowercase, it would switch to byte mode, which takes more space. Small detail, real effect: uppercase text can produce a slightly less dense grid.

Step 2: Build the bit stream

The encoder writes a short header first: a 4 bit mode indicator (“this is alphanumeric”) and a character count (“11 characters follow”). Then it converts the text. Each character has a value (H is 17, E is 14), and pairs are combined into one number written as 11 bits. HELLO WORLD becomes roughly 60 bits of real data.

Step 3: Pad and split into codewords

Each size has a fixed number of data slots. If the message is shorter, the encoder adds a terminator and filler bytes until every slot is used. The stream is then cut into 8 bit chunks called codewords, the bricks the rest of the process works with.

Step 4: Add error correction codewords

Next, the data runs through Reed-Solomon error correction, which creates extra codewords. They hold no new information. They hold clues that let a scanner rebuild missing or damaged data.

Step 5: Place the bits on the grid

Codewords are laid out from the bottom right corner, moving upward in a two column wide zigzag, then down, then up again, skipping the fixed patterns. Dark means 1, light means 0.

Step 6: Apply the best mask

If the data created big blocks of one color, or a shape that looks like a finder, cameras would get confused. So the encoder tests eight mask patterns, flips certain modules for each, scores the results, and keeps the cleanest one. Your phone later removes the same mask to get the original bits back.

Why a Damaged QR Code Still Scans

Ever scanned a crumpled flyer or a coffee stained label and it still worked? That is error correction, and it is the main reason this format beats older barcodes.

Reed-Solomon error correction adds backup codewords so a scanner can rebuild data even when part of the code is missing or dirty. The same family of math protects music CDs and was first developed for satellite communication. Denso Wave explains its QR code error correction levels on its official site.

When you create a code, you choose one of four levels:

LevelDamage it can recoverBest for
L (Low)About 7%Clean screens, maximum data
M (Medium)About 15%Everyday use, the common default
Q (Quartile)About 25%Outdoor signs, packaging, labels
H (High)About 30%Codes with a center logo or rough environments

There is a trade off. More backup data means less room for content or a denser grid. I use M for screens and simple links, and H whenever I place a logo in the center, because a logo physically covers modules and needs that extra safety net.

How Much Data Can a QR Code Hold?

There are 40 versions. Version 1 is a grid of 21 by 21 modules, and each version adds 4 modules per side, up to version 40 at 177 by 177.

At version 40 with level L, a single code holds up to:

Data typeMaximum capacity
Numeric digits7,089
Alphanumeric characters4,296
Bytes2,953
Kanji characters1,817

These are ceilings, not targets. A version 40 code is so dense that most phones struggle unless it is printed large. At the other end, version 1 at level L holds just 17 bytes, and only 7 at level H. That is why a long URL creates a busy, crowded pattern, and why many people shorten links first.

How Your Phone Reads a Code in Under a Second

This is the other half of how do QR codes work: the scanner side. When you point your camera at a code:

  1. Detect: The camera looks for the 1:1:3:1:1 finder ratio in each frame.
  2. Straighten: It locates all three finders, then uses the alignment pattern to correct tilt and curve.
  3. Measure: Timing patterns reveal the module size and version.
  4. Read the format: It reads the error correction level and mask.
  5. Unmask and repair: It removes the mask, then Reed-Solomon decoding fixes misread modules.
  6. Decode: It reads the mode and character count and rebuilds the text.
  7. Act: A URL gets an “open” prompt, a Wi-Fi string offers to join, contact details offer to save.

Apple added scanning to the iPhone Camera app with iOS 11 in 2017, and most modern Android phones scan through the camera or Google Lens. You no longer need a separate app.

Does it need internet?

No. Reading a code happens entirely on your device. The data is printed right there in the squares. You only need internet if the decoded content is a link you want to open. Plain text, a phone number or Wi-Fi details work fully offline.

QR Code vs Barcode

People often ask me if this is just a fancy barcode. Technically it is a type of barcode, but it is a very different tool.

FeatureTraditional barcode (1D)QR code (2D)
Data directionOneTwo
Typical capacityAbout 20 charactersUp to 7,089 digits
Error correctionLittle or noneUp to about 30% recovery
Scan angleFairly straightAny angle
Phone camera supportSometimes, with an appBuilt into most phones
Common useRetail price lookupLinks, payments, tickets, Wi-Fi

For a deeper look at related 2D formats like Micro QR and rMQR, the encyclopedia entry on the QR code is a solid starting point.

Static vs Dynamic QR Codes

This matters a lot before you create one, especially for business.

A static code stores your data directly in the squares and can never be changed. A dynamic code stores a short redirect link that points to your real destination, which you can edit later.

FeatureStaticDynamic
Where data livesInside the codeOn a server, behind a short link
Editable after printingNoYes
Scan trackingNoUsually yes
ExpiresNeverCan stop if the service ends or a plan lapses
CostUsually freeOften paid
Best forWi-Fi, text, permanent linksMenus, campaigns that change

My honest advice: if you print something permanent and do not need statistics, use static. It cannot break because a company shut down or a subscription expired.

How to Make a QR Code (Step by Step)

Learning how to make a QR code takes about a minute, and you need no design skills.

  1. Decide what it should do: open a link, show text, share Wi-Fi, or save a contact.
  2. Open a QR code generator. A free online QR code generator works perfectly for static codes.
  3. Paste your content into the box.
  4. Pick error correction. M is a good default; use H if you will add a logo.
  5. Download as PNG for screens, or SVG for print if offered.
  6. Test it with at least two different phones before printing or sharing.

How to make a QR code for a link

For a YouTube video, a Google Form or a social profile, here is how to make a QR code for a link:

  1. Copy the full URL from the address bar.
  2. Open it in a private browser window to confirm it is not tied to your login.
  3. Paste it into the QR code generator.
  4. If the link is very long, use a shorter version. Fewer characters mean a cleaner pattern.
  5. Download and test on both iPhone and Android.

How to make a QR code for a website

The steps for how to make a QR code for a website are the same, plus a few points that matter for businesses:

  • Point to the right page. A flyer for a sale should open the sale page, not your homepage.
  • Always use https, since some phones warn about non secure links.
  • Check the page on mobile. Everyone who scans lands there on a phone.
  • Choose static if the URL will never change, and dynamic if you plan to update the destination.

Printing Tips That Keep Codes Scannable

I have seen beautiful designs that simply do not scan. The rules I follow:

  • Strong contrast: dark modules on a light background. Inverted colors confuse many scanners.
  • Respect the quiet zone: a clear margin at least four modules wide.
  • Size for distance: a common rule of thumb is about one tenth of the scanning distance, so roughly 10 cm wide for scanning from 1 meter. Around 2 cm is the practical minimum for business cards.
  • Never stretch it. Resize proportionally.
  • Keep logos small and use level H.
  • Test the final print, not just the file on your screen.

Common Mistakes to Avoid

  1. Linking to a page that later disappears. A static code pointing to a deleted page is useless forever.
  2. Using a dynamic code from a free trial. When the trial ends, every printed code can die.
  3. Cramming in too much data. Tiny modules fail in poor light.
  4. Skipping the test scan. One wrong character ruins the whole print run.
  5. Bad placement, like on a moving vehicle or too high on a wall.
  6. Reusing an old image without checking it. If you find a code on your computer and cannot remember where it leads, decode it first.

How to Read a QR Code Without a Phone

Sometimes the code is already on your computer: in a PDF, an email, or a screenshot. You cannot point your phone at your own phone.

That is where a QR code to text converter helps. You upload the image and it shows the raw text or link inside. I use this for three things:

  • Checking a link before visiting it, so I can judge whether the URL looks safe.
  • Recovering Wi-Fi details. A Wi-Fi code contains text like WIFI:T:WPA;S:NetworkName;P:Password;; which reveals the network name and password.
  • Copying data into documents without retyping contact details or serial numbers.

Are QR Codes Safe?

A QR code itself cannot hack your phone, but the link inside it can lead to a fake website or a harmful download. The danger is the destination, not the squares.

Scammers use quishing, short for QR phishing. They stick fake codes over real ones on parking meters and posters, or send codes in urgent emails that lead to pages built to steal logins or card details. The US Federal Trade Commission has a clear consumer alert about scammers hiding harmful links in QR codes. Based on that advice and my own habits:

  • Read the link preview before tapping. Watch for tricks like “paypa1” instead of “paypal.”
  • Distrust codes in unexpected messages, especially urgent ones.
  • Check public codes for stickers placed on top of the original.
  • Never enter passwords or card details on a page reached through a random scan. Open the official site or app yourself.
  • Keep your phone updated.

Also, these codes are not encrypted by default. Anyone who scans one can read it, so never put private data in a public code.

Key Takeaways

  • How do QR codes work in one line: data becomes binary, gets error correction, and is drawn as modules a camera can read.
  • A QR code is a 2D matrix barcode created by Denso Wave in 1994 to track car parts.
  • It stores data as dark (1) and light (0) modules on a grid from 21 by 21 up to 177 by 177.
  • Three finder patterns let your phone find and orient it from any angle.
  • Data is encoded in numeric, alphanumeric, byte or Kanji mode and protected with Reed-Solomon error correction.
  • Levels L, M, Q and H recover roughly 7%, 15%, 25% and 30% of damage.
  • One code holds up to 7,089 digits or 2,953 bytes, but smaller is easier to scan.
  • Reading works offline; opening a link needs internet.
  • Static codes never expire. Dynamic codes are editable but depend on a service.
  • Most risk comes from fake links, so always check where a code leads.

Conclusion

So, how do QR codes work? They turn your information into binary, protect it with Reed-Solomon error correction, and draw it as squares with built in guides that any camera can find, straighten and read in a fraction of a second. What began as a way to track car parts in Japan is now how millions of people pay, order food, share Wi-Fi and open websites every day.

Now that you know what happens inside those squares, you can make better codes, avoid common mistakes, and spot the warning signs of a scam.

Have a code saved on your computer and want to see what is inside? Use our free QR Code to Text Converter to upload the image and instantly decode the text or link it holds, no phone needed.

Frequently Asked Questions

1. What does QR stand for?

QR stands for “Quick Response.” The name reflects the original goal: a code that could be read much faster than traditional barcodes in busy car factories.

2. Who invented the QR code?

Masahiro Hara and his team at Denso Wave in Japan developed it and announced it in 1994. It was first used to track automotive parts during manufacturing.

3. Do QR codes expire?

Static codes never expire because the data lives inside the pattern. Dynamic codes can stop working if the service managing the redirect shuts down or your subscription ends.

4. Can I scan a QR code without an app?

Yes. iPhones on iOS 11 or later scan with the built in Camera app, and most recent Android phones scan through the camera app or Google Lens.

5. Do QR codes need the internet?

Decoding does not need internet, because the data is printed in the squares. You only need a connection to open a web link stored inside.

6. How much data can a QR code store?

The largest version, 40 at low error correction, holds up to 7,089 digits, 4,296 alphanumeric characters, 2,953 bytes, or 1,817 Kanji characters.

7. Can a QR code be hacked?

The pattern itself cannot attack your phone. The real risk is a malicious link inside, or a fake sticker placed over a genuine code. Check the link before opening it.

8. Why is my QR code not scanning?

Common causes are low contrast, a missing quiet zone, printing too small, glare on glossy material, or too much data. Testing with two phones usually reveals the problem.

9. Can I put a logo in the middle?

Yes. Keep the logo small and use error correction level H, which recovers about 30% of the pattern. Always test the final design before printing.

10. Are QR codes free to make?

Static codes are free with most online tools and have no usage limits. Dynamic codes with editing and scan tracking usually come with a paid plan.