What Is a QR Code and How Does It Work?

From a Japanese car factory to your phone camera: how QR codes store information, why they survive scratches and logos, and how to create and scan them safely.

Guides 8 min read

You see them on menus, posters, packages and payment screens: a small square of black and white dots that opens a website when you point your phone at it. But what is actually inside that square, and why does it work even when it is a little dirty or torn?

In this guide you will learn what a QR code is, how it stores data, how error correction works, what you can put inside one, how to make your own for free and how to avoid the scams that use them.

Create your QR code now Turn a link, text, Wi-Fi network or contact into a QR code in seconds. It is generated in your browser and never expires. Open the QR code generator

What is a QR code?

QR stands for Quick Response. A QR code is a two-dimensional barcode: instead of storing data in a single row of bars like a supermarket barcode, it stores data across a grid of small black and white squares, in both width and height.

It was invented in 1994 by Denso Wave, a Japanese company in the Toyota group, to track car parts during manufacturing. Ordinary barcodes held too little information and were slow to scan, so the engineers created a code that could hold more data and be read quickly from any angle. Today it is used far beyond factories, and anyone can create one for free.

How does a QR code store data?

The grid is made of tiny squares called modules. Each module is either dark or light, and together they encode your text as a pattern of ones and zeros. Your phone camera sees the pattern, a decoder turns it back into text and the phone decides what to do with it, such as opening a link.

Some parts of the grid are not data at all. They help the scanner find and read the code:

  • Finder patterns: the three large squares in three corners. They tell the scanner where the code is, its orientation and its size, which is why a QR code scans even when rotated or upside down.
  • Alignment patterns: smaller squares inside larger codes that correct distortion when the code is printed on a curved or tilted surface.
  • Timing patterns: alternating dark and light lines that help the scanner measure the grid and count the modules correctly.
  • Quiet zone: the empty margin around the code, which separates it from whatever is printed nearby.

Codes come in versions from 1 to 40. Version 1 is a 21 by 21 grid, and each version adds more modules, up to 177 by 177. The more data you store, the denser the code becomes.

Error correction: why damaged codes still scan

QR codes include extra data that works like a safety net. Using a method called Reed-Solomon error correction, the scanner can rebuild missing or unreadable parts of the code. There are four levels, and the percentage is roughly how much of the code can be damaged or hidden while it still scans:

  • Level L (Low): recovers about 7%.
  • Level M (Medium): recovers about 15%.
  • Level Q (Quartile): recovers about 25%.
  • Level H (High): recovers about 30%.

Why a logo in the middle does not break it

This is also why you often see QR codes with a logo placed in the center. The logo covers some modules, but the error correction fills in the gap. The higher the level, the more you can cover, but a higher level also makes the code denser and harder to read at a small size.

Use a small logo, keep it away from the three corner patterns and test the result. If a code with a logo does not scan reliably, remove the logo or raise the correction level.

Tip: level M is a good default for most uses. Choose Q or H only if the code will be printed in rough conditions or you want to add a logo.

What can a QR code contain?

A QR code is just a container for text, and phones know how to interpret several formats. The most common are:

  • A website link (URL): the most popular use, to open a page, a menu or a form.
  • Plain text: a message, a note or a code that an app reads.
  • Wi-Fi details: network name, password and security type, so guests can join with one scan.
  • A contact card (vCard): name, phone, email and address that can be saved to the address book.
  • A WhatsApp link: opens a chat with a given number, with an optional ready-made message.
  • An email address, a phone number or an SMS, which open the matching app.

How to create a QR code in 3 steps

  1. Open the free QR code generator and choose what the code should contain: a link, text, Wi-Fi, a contact or a WhatsApp message.
  2. Type or paste your content, then adjust the colors, size and error correction level if you want.
  3. Download the image, scan it with your phone to confirm it works and only then print or share it.

The codes made here are static: the content is written directly into the image, so they never expire and keep working forever. They are generated in your browser, so your data is not sent anywhere. The trade-off is that a static code cannot be edited later: if the link changes, you need a new code.

Design tips for codes that scan every time

  • Keep strong contrast: dark modules on a light background work best. Light modules on a dark background can fail on some scanners.
  • Do not remove the quiet zone: leave an empty margin around the code, about four modules wide.
  • Do not make it too small: as a rule of thumb, print it at least 2 cm (about 0.8 inch) wide, and larger when people will scan from a distance.
  • Keep it flat and clean: avoid printing on wrinkled, glossy or curved surfaces that reflect light.
  • Use shorter content: less data means a simpler code that is easier to scan. A short link beats a long one.
  • Always test before printing: scan it with at least two different phones, ideally at the real size and distance.

Staying safe: quishing and fake codes

A QR code hides its destination, so you cannot tell where it leads just by looking. Criminals take advantage of this with what is called quishing (QR phishing): a code that leads to a fake login or payment page designed to steal your data.

A few habits keep you safe:

  • Scan, then check: read the link your phone shows before you open it, and make sure the domain is the one you expect.
  • Do not scan random codes from unknown emails, messages or flyers.
  • Beware of stickers placed over a real code, for example on parking meters, tables or posters. If the code looks stuck on top, do not trust it.
  • Never enter passwords, card numbers or personal data on a page you reached through a code unless you are sure it is genuine.
  • Be careful with codes that install apps or ask you to hurry.

Common mistakes to avoid

  • Printing the code too small or with low contrast, and never testing it.
  • Placing a big logo over the center without raising the error correction level.
  • Putting a very long link inside the code, which makes it dense and hard to scan.
  • Using colors that look nice but have too little contrast, such as yellow on white.
  • Cropping the white margin so the code touches other graphics.
  • Sending people to a page that is not mobile friendly.

Conclusion

A QR code is a grid of black and white modules that stores text in a way a camera can read quickly, with built-in error correction that lets it survive damage. Create yours with the free generator, keep strong contrast and a clear margin, test it before printing and always check where a code leads before you trust it.

Frequently asked questions

Does a QR code expire?

A static QR code never expires, because the content is stored inside the image itself. It stops being useful only if the page it points to goes offline.

Can a damaged or covered QR code still be scanned?

Often yes. Error correction lets a scanner rebuild missing parts, recovering roughly 7% (L), 15% (M), 25% (Q) or 30% (H) of the code. Beyond that limit, or if the three corner squares are damaged, it may fail.

Is it safe to make a QR code with an online generator?

It is safe when the generator works in your browser and does not send your content to a server. Ours creates the code locally on your device and does not store what you type.

Do I need an app to scan a QR code?

Usually not. The camera app on most modern phones recognizes QR codes and shows the content or link. Just point the camera at the code and tap the notification.

Can a QR code be dangerous?

The code itself is only data, but it can lead to a harmful page. Check the link before opening it, avoid codes from unknown sources and be suspicious of stickers placed over other codes.

Free tools mentioned in this article

Keep reading

All articles