How does a QR code store information?

A QR code stores data as a square grid of dark and light modules that encode binary data, plus error-correction codes, so a camera can read it from any angle.

AI-drafted from web search results, then checked by a second, independent AI that read 5 of its 5 cited pages in full and found the thread supported. No person has reviewed it.

0 views
Diagram of a QR code with a grid of dark and light modules. Colored overlays mark the version and format information areas, the position, alignment and timing patterns, and the surrounding quiet zone, with a legend on the right.
A labeled example QR code showing its functional elements: version information, format information, data and error-correction keys, required patterns (position, alignment, timing), and the quiet zone. Image: Zephyris, CC BY-SA 3.0, via Wikimedia Commons. Chosen automatically; not checked by a person.
Sourced

The short answer

A QR code is a two-dimensional barcode that holds data in a square grid of dark and light boxes, called modules. Each module stands for a binary one or zero. Unlike a standard barcode, which stores information along one horizontal axis, a QR code uses both the horizontal and vertical axes, which lets it hold much more data in a small space. According to [scandit.com](https://www.scandit.com/products/barcode-scanning/symbologies/qr-code/), it can be read from any orientation. Most often it stores a web link, though it can hold other text or arbitrary data, as [theconversation.com](https://theconversation.com/how-qr-codes-work-and-what-makes-them-dangerous-a-computer-scientist-explains-177217) notes. [1] [2]

Or ask in your own AI
Sourced

The parts of the grid

The grid ranges from 21 by 21 modules at its smallest (version 1) to 177 by 177 at its largest (version 40). Three large squares in the corners, called finder or position patterns, let a scanner locate the code and work out its orientation. A blank border called the quiet zone marks where the code begins and ends. Other reserved areas include timing patterns, which help a scanner determine the structure of the grid, alignment patterns, which correct for image distortion, and format and version information, which record the error-correction level, the mask used and the code's size. The remaining modules carry the data itself and the error-correction data. [1] [2] [3]

Or ask in your own AI
Sourced

From text to modules

According to [useqr.app](https://useqr.app/docs/spec/how-qr-codes-are-generated), an encoder first picks the most compact mode for the input. Numeric mode uses about 3.33 bits per character, alphanumeric 5.5, byte 8 and kanji 13. Each segment begins with a 4-bit mode indicator and a character count, followed by the data, then a terminator and padding bytes until the version's capacity is filled. The bit stream is cut into 8-bit codewords, which are grouped into blocks. Error-correction codewords are added, the blocks are interleaved, and the bits are placed in a zigzag path through the grid. Finally the encoder tries eight mask patterns and keeps the one with the lowest penalty score, which helps keep the pattern easy to scan. [4]

Capacity depends on the version, character type and error-correction level. [scandit.com](https://www.scandit.com/products/barcode-scanning/symbologies/qr-code/) lists version 40 at the lowest correction level as holding up to 7,089 numeric characters, 4,296 alphanumeric characters or 2,953 bytes of binary data. [1]

Or ask in your own AI
Sourced

Why damaged codes still work

QR codes use Reed-Solomon error correction, which adds extra codewords computed from the original data so a scanner can rebuild missing parts. There are four levels: L restores about 7 percent of the data, M 15 percent, Q 25 percent and H 30 percent. Higher levels need more space. Interleaving spreads codewords from different blocks across the symbol, so a scratch damages several blocks a little rather than one block entirely, according to useqr.app. This redundancy is also why a logo can sit in the middle of a code. The Conversation explains that the logo covers some data, which is recovered from the visible modules. [1] [4] [2]

Or ask in your own AI
Sourced

Origins

Scandit states that Masahiro Hara of DENSO Wave invented the QR code in 1994, and that the widely used Model 2 version is standardized in ISO/IEC 18004:2024. Wikipedia's summary adds that the system spread beyond the automobile industry because it could be read faster and held more data than standard UPC barcodes. [1] [5]

Or ask in your own AI

Sources

  1. QR Codes: Complete Technical Guide | Scandit (scandit.com) Found by source search. Not checked by a person.
  2. How QR codes work and what makes them dangerous – a computer scientist explains (theconversation.com) Found by source search. Not checked by a person.
  3. How QR codes work | QRCodeSDK (qrcodesdk.dev) Found by source search. Not checked by a person.
  4. How a QR code is generated, step by step · UseQR (useqr.app) Found by source search. Not checked by a person.
  5. QR code (en.wikipedia.org) Found by source search. Not checked by a person.

Questions to follow next

  • How do Reed-Solomon codes actually repair missing data?
    Or ask in your own AI
  • Why are QR codes considered a security risk?
    Or ask in your own AI
  • What is the difference between a QR code and a regular barcode?
    Or ask in your own AI

Keep going