Follow
Subscribe via Email!

Enter your email address to subscribe to this platform and receive notifications of new posts by email.

QR Codes: How Two-Dimensional Matrix Systems Work

QR codes store data across two dimensions using square modules, position detection markers, and Reed-Solomon error correction to allow rapid optical scanning.
A person holding a smartphone scanning a QR code displayed on a computer screen.

A quick response code functions as a two-dimensional matrix barcode that stores digital information across a grid of black and white squares. Invented by engineer Masahiro Hara at Denso Wave in 1994 to track automobile parts, the format holds far more information than traditional linear barcodes while allowing optical scanners to read data from any angle [3]. Learning how QR codes work reveals a system built on geometric alignment patterns and mathematical error correction designed to deliver stored text, identifiers, or web links to imaging devices [4].

The Architecture of Two-Dimensional Matrices

Standard linear barcodes store data along one horizontal axis using alternating vertical stripes of varying widths. That layout works well at retail checkout registers equipped with point-of-sale (POS) optical scanners, but it caps total data storage at roughly 20 alphanumeric characters. When automotive parts suppliers in the Toyota Group needed to record manufacturing histories, parts numbers, and shipping routes on single crates, factory workers had to paste up to 10 separate barcodes onto a single cardboard container [3].

Two-dimensional matrix barcodes overcome that physical bottleneck by arranging data across horizontal and vertical coordinates within a square grid. The foundational building blocks of a QR code are tiny square units called modules, arranged in a precise checkered pattern that digital image sensors read as binary values. A dark module represents a binary one, while a light module represents a binary zero [4]. By distributing bits along two spatial dimensions rather than a single stripe, the matrix packs extensive data into a compact physical surface [2]. Optical scanners capture the entire square in a single camera exposure rather than sweeping a red laser beam across one line. Sensor chips at Denso Corporation designed specialized decoders to process visual patterns into digital bytes within milliseconds [4].

Decoding software reads the extracted bitstream to retrieve stored text or web links without manual typing. This design lets industrial equipment and mobile phones retrieve records without physical contact [5]. During busy shipping seasons at Denso Wave manufacturing plants, warehouse teams eliminated major data entry bottlenecks across Japanese production facilities [3].

Square QR code pattern on a medium blue background
A two-dimensional QR code linking mobile devices to web resources. (Credit: Digital.gov)

Data Modes Explaining How QR Codes Work

To store diverse categories of data efficiently, the system uses four standardized encoding modes: numeric, alphanumeric, byte, and kanji. Each mode applies a distinct mathematical rule to convert characters into binary bits, optimizing space based on the nature of the input text. For numerical sequences such as part serial numbers or inventory counts, numeric mode packs three decimal digits into just 10 binary bits [4].

Alphanumeric mode encodes digits zero through nine, uppercase letters, and nine punctuation symbols, packing two characters into 11 bits to save room on shipping labels and posters. The byte mode handles eight-bit binary data, allowing QR codes to store standard Latin text, web addresses, and raw data files with complete accuracy [4]. Because the code originated in Japan, Masahiro Hara and his team created a kanji mode that encodes double-byte Shift JIS characters into 13 bits, which enabled a single code to store up to 1,800 kanji characters, an amount comparable to a full printed A4 page of documentation [3]. In total, the largest standard QR code matrix can encode up to 7,000 numerals [1].

Data modes explaining how QR codes work clarify why matrix patterns shift between different printed items. When generator software creates a symbol for a website link, it writes the encoding mode into a short header before placing payload modules. Generators switch between modes within a single symbol to keep the final printed square as compact as possible [4].

The 1:1:3:1:1 Position Detection Pattern

Why did the design rely on squares rather than circles? Denso Wave needed geometric shapes that optical readers could detect instantly from any scanning angle [1]. The most prominent features of any QR code are the three square marks nested in three corners of the outer grid [3]. The development team chose a 1:1:3:1:1 ratio for the alternating dark and light modules inside each marker [1].

Masahiro Hara conceived the nested square structure after observing visual patterns in daily life, drawing early ideas from the black and white stones on a Go board and noting building windows during his daily commute [3]. To ensure that optical readers would never mistake surrounding graphics, newspaper text, or cardboard packaging for a position marker, Hara and his team surveyed printed matter across Japan. They measured the widths of alternating black and white segments on flyers, magazines, and boxes until they determined that the 1:1:3:1:1 ratio was the least common sequence in print [1].

Masahiro Hara holding an early QR code design document
Engineer Masahiro Hara developed the QR code at Denso Wave in 1994. (Credit: Denso Wave Inc. via The Mainichi)

Because of this geometric signature, scanners determine code boundaries and tilt across 360 degrees [1]. If an automotive part passes along a factory conveyor belt in Japan at an awkward tilt, the sensor still reads the three corners in milliseconds [3]. Smaller alignment patterns help larger codes correct for curved surfaces [4].

Reed-Solomon Error Correction

Factory floors and outdoor shipping docks present harsh conditions where printed labels get scratched, smudged with oil, or torn by machinery. To keep barcodes readable under physical damage, the developers built Reed-Solomon error correction directly into the matrix layout. This mathematical system adds redundant error correction codewords to the payload data, enabling optical decoders to calculate and reconstruct missing or corrupted bits during image processing. If dirt obscures part of the symbol, algorithms use the surviving parity blocks to solve polynomial equations and recover the original message. Engineers at Denso Wave noted that similar mathematical coding had been used to transmit deep-space telemetry through noisy communication channels [4].

The international standard defines four error correction levels, designated as L, M, Q, and H. Level L restores up to 7 percent of damaged data, while Level M restores up to 15 percent [4]. Level Q recovers 25 percent, while the highest grade (Level H) restores up to 30 percent of damaged modules [2].

This built-in mathematical resilience explains how QR codes work when designers insert corporate logos or custom artwork into functional codes. Because Level H tolerates significant missing data, illustrators can replace central modules with custom branding without breaking scanner readability [4]. Computer scientists have expanded on this capability to create stylized aesthetic QR codes, blending photographic imagery directly into functional matrices while preserving algorithmic decoding performance [7]. Computer graphics researchers Chu and colleagues developed halftone QR codes that modify module shapes to depict images while maintaining machine readability across distorted surfaces. Their algorithm balances visual tone with data recovery constraints to ensure mobile devices still decode the altered patterns [6].

Contact tracing QR code sign on a cafe table in Melbourne
Venues displayed scannable check-in codes during public health contact tracing efforts. (Credit: Getty via ABC News)

Automotive Roots at Denso Wave

The technology originated from industrial logistics within Japan’s manufacturing sector in the early 1990s. Masahiro Hara worked in the barcode development division at Denso Corporation, an equipment supplier in the Toyota Group. Denso managed parts tracking through Toyota’s kanban production method, a just-in-time logistics system that relies on precise component labeling to prevent factory delays across assembly lines [3].

Tracking auto parts with 20-character barcodes became unsustainable as automotive component variations multiplied across Japanese assembly plants [3]. Repetitive manual scanning caused wrist numbness among warehouse staff. “We’d like the capability to code Kanji and Kana characters as well as alphanumeric ones,” factory users told Denso developers. In 1992, Masahiro Hara began development with just one other engineer at Denso Corporation, spending a year and a half testing optical prototypes until Denso Wave announced the completed Quick Response code in 1994 [1]. One square matrix replaced ten individual barcodes on every shipment container [3].

Rather than locking the technology behind proprietary licensing fees, Denso Wave released the specifications to the public. Denso retained patent rights but pledged never to exercise them against users [1]. The company planned to generate revenue by selling scanner hardware instead [3]. International bodies soon codified the format, granting approval as an AIM standard in 1997, a Japanese Industrial Standard (JIS) in 1999, and an ISO standard in 2000 [1].

SafeEntry check-in poster showing how QR codes work for visitors at a park in Singapore
Instructions and code for the SafeEntry check-in system displayed in Singapore. (Credit: Getty via ABC News)

How QR Codes Work Across Mobile Handsets

For nearly a decade after its 1994 release, the format remained strictly confined to industrial warehouses and automotive assembly plants. That boundary dissolved in 2002 when Sharp Corp. released a commercial mobile phone featuring a built-in optical scanner, allowing Japanese consumers to scan magazine advertisements and open mobile websites directly from their handsets [3]. Adoption accelerated across Japan as mobile carriers promoted scannable print campaigns [1].

In the United States and Europe, adoption progressed more slowly because early smartphone users had to install third-party scanning apps such as NeoReader, TapMedia’s QR Reader, or Barcode Scanner from app stores [9]. Retailers began printing codes on flyers, billboards, and store shelves. Best Buy added codes to product tags across stores in 2010 to show shopper reviews, recording roughly 3,000 scans daily. Mike Wehrs, president of Scanbuy, explained how QR codes work to engage shoppers as daily American scans jumped from 1,500 to 40,000 during 2010. Friction lingered because consumers disliked downloading standalone scanning utilities [8].

How QR codes work across mobile handsets changed fundamentally when Apple launched iOS 11 in 2017, enabling the native iPhone camera to scan codes automatically without separate software [9]. Android handset makers quickly matched that native capability. Beyond advertising, cultural institutions adopted the format through QRpedia in 2011, created by Roger Bamkin and Terence Eden at Derby Museum and Art Gallery to display multilingual Wikipedia articles on museum placards [17]. In 2008, Japanese stonemason Ishi no Koe placed codes on cemetery gravestones to display photos and memorials [18].

Contactless Menus in Hospitality

The onset of the COVID-19 pandemic in 2020 sparked a major surge in scanning activity across public life. To limit physical contact and meet public health guidance from the Centers for Disease Control and Prevention (CDC), restaurants removed paper menus from dining tables [11]. Venues affixed adhesive QR code stickers to tables and windows, pointing diners to online menus on their mobile browsers [10].

Hospitality operators found that digital menus offered practical advantages over printed booklets. “Digital menus liberate a chef from hesitating about introducing a new dish that requires a menu overhaul,” restaurateur Jonah Miller explained in The Counter. Amanda Kludt at Eater reported that codes reduced server contact while helping restaurants collect guest information [11]. Checkout providers like Square launched self-ordering tools on free subscription plans, letting guests scan a table code and pay bills directly from smartphones [10]. By 2022, approximately 89 million people across America scanned codes with smartphones, marking a 26 percent increase over two years earlier. September 2020 surveys showed that roughly 19 percent of British and American diners noticed increased code use after pandemic restrictions began [4].

QR Codes: How Two-Dimensional Matrix Systems Work — Digital.gov image
(Credit: Digital.gov)

Governments also deployed codes to coordinate contact tracing. Australian states like New South Wales and Victoria required venues to log customer contact details, keeping records up to 56 days. Justin Warren of Electronic Frontier Australia (EFA) expressed concern that commercial data brokers might gather consumer information without oversight. University of New South Wales epidemiology professor Marylouise McLaws recommended a unified registry similar to Sydney’s Opal Card transport system. Singapore ran its SafeEntry check-in program, while European authorities embedded health data into the EU Digital COVID Certificate [12], [3].

Financial Networks and How QR Codes Work

Beyond linking to websites, the matrix barcode underpins mobile financial networks worldwide. Early payment mechanisms originated in December 2010 when Shaun Cooley and Andrew Charles Payne filed patent applications for Norton Mobile Pay at Symantec, describing methods for mobile cameras to scan point-of-sale codes. In 2011, Alipay introduced a QR payment method, followed by Tencent’s WeChat Pay in 2014, transforming retail commerce across Mainland China [13].

In Chinese cities like Beijing, Shenzhen, and Xi’an, scannable payments turned physical cash into a rare sight across shopping malls, fruit stands, and subway turnstiles [14]. By 2018, mobile payments accounted for 83 percent of all transactions in China, with Alipay holding a 54 percent market share and WeChat Pay holding 40 percent [13],. Street performers in Xi’an displayed printed cards from Alibaba Group and Tencent to collect tips in seconds. The simplicity of printing a code on paper meant that any merchant could accept digital payments without buying expensive card terminals [14]. To curb fraud linked to counterfeit printed stickers, the People’s Bank of China introduced payment regulations, placing an entry cap of 500 yuan on traditional static codes while higher security tiers raised caps to 5,000 yuan [15].

Central banks and payment networks now establish national unified specifications to connect competing payment apps. In Cambodia, the National Bank of Cambodia introduced the standardized KHQR format across its Bakong blockchain network, enabling one universal code to process transfers between dozens of partner institutions in Phnom Penh [16]. Other unified payment networks include BharatQR in India, qvik in Hungary, and SPD in the Czech Republic. Transit turnstiles also adopted scannable tickets on Line 1 of the Mumbai Metro and the LRT-1 system in the Philippines [13]. Financial networks and how QR codes work demonstrate how an automotive tracking tool created in 1994 evolved into a universal foundation for global digital commerce [4].

Sources
  1. WEBSITE Denso Wave Incorporated. (1997). History of QR Code: How was the QR Code created? [Article Link]
  2. WEBSITE Denso Wave Incorporated. (n.d.). What is a QR Code? [Article Link]
  3. ONLINE NEWS Sugiyama, Y. (2021, November 10). From Japanese auto parts to ubiquity: A look at the history of QR codes. The Mainichi. [Article Link]
  4. WEBSITE Wikipedia contributors. (n.d.). QR code. Wikipedia, The Free Encyclopedia. [Article Link]
  5. WEBSITE Digital.gov. (2023, February 2). Introduction to QR codes. [Article Link]
  6. ACADEMIC JOURNAL Chu, H., Chang, C., Lee, R., & Mitra, N. J. (2013). Halftone QR codes. ACM Transactions on Graphics, 32(6), 1–8. [Article Link]
  7. ACADEMIC JOURNAL Xu, M., Su, H., Li, Y., Li, X., Liao, J., Niu, J., Lv, P., & Zhou, B. (2019). Stylized aesthetic QR code. IEEE Transactions on Multimedia, 21(8), 1960–1970. [Article Link]
  8. ONLINE NEWS Stock, S. (2010, November 11). Marketers scatter phone-friendly codes across ads. Phys.org. [Article Link]
  9. ONLINE NEWS Edwards, C. (2010, December 6). List of QR code readers for iPhone, Android, Windows Phone 7 and BB. 708 Media. [Article Link]
  10. ONLINE NEWS Kastrenakes, J. (2020, September 29). Square launches QR codes that let you order from your table at a restaurant. The Verge. [Article Link]
  11. ONLINE NEWS Leger, B. (2020, October 27). QR codes are replacing physical menus at restaurants. 225 Magazine. [Article Link]
  12. ONLINE NEWS Purtill, J. (2020, November 20). Dining in? Here’s the QR code. but where does the data go? ABC News. [Article Link]
  13. WEBSITE Wikipedia contributors. (n.d.). QR code payment. Wikipedia, The Free Encyclopedia. [Article Link]
  14. ONLINE NEWS Jacobs, H. (2018, May 29). One photo shows that China is already in a cashless future. Business Insider. [Article Link]
  15. ONLINE NEWS Kastrenakes, J. (2017, December 28). China begins regulating QR code payments. The Verge. [Article Link]
  16. REPORT National Bank of Cambodia. (2021, August 6). Easy and fast way to register. Bakong. [Article Link]
  17. WEBSITE Wikipedia contributors. (n.d.). QRpedia. Wikipedia, The Free Encyclopedia. [Article Link]
  18. ONLINE NEWS Novak, A. (2008, March 23). Japanese gravestones memorialize the dead with QR codes. WIRED. [Article Link]
Leave a Comment

Related Posts
Total
0
Share