Create QR codes for URLs, text, WhatsApp, email, all in the browser with no data sent.
Origin and standard
The QR (Quick Response) code was invented in 1994 by Masahiro Hara at Denso Wave, a Toyota subsidiary, to track automotive parts. It replaced barcodes, which could encode only about 20 digits, with a two-dimensional format that could encode thousands of characters and be scanned from any angle.
QR codes are defined by the ISO/IEC 18004 standard. The specification is open and royalty-free, which is why QR scanning is built into every modern smartphone camera today and used for everything from payments to Wi-Fi credentials.
Anatomy of a QR code
Every QR code has the same structural elements, visible in any sample:
- Finder patterns: the three large squares in the corners — anchor scanner orientation
- Alignment patterns: small squares inside larger codes — correct perspective distortion
- Timing patterns: alternating modules between finders — establish module sizing
- Version and format information: encodes which QR version and error-correction level
- Data modules: the actual encoded content, error-corrected via Reed-Solomon
- Quiet zone: the mandatory white border around the code
Versions and capacity
QR codes come in 40 versions, from version 1 (21×21 modules) to version 40 (177×177 modules). Each version adds 4 modules per side. Larger versions encode more data but are harder to print at small physical size and harder to scan from a distance.
Maximum capacity at the lowest error-correction level is approximately 7,089 numeric digits, 4,296 alphanumeric characters, or 2,953 bytes (suitable for raw binary or UTF-8 text). Real-world QR codes rarely need more than a URL, which fits in a small version 2 or 3 code.
Error correction levels
QR codes use Reed-Solomon error correction to remain readable despite smudges, partial damage, or logo overlays. Four levels are available, each trading capacity for damage tolerance.
- Level L (Low): recovers up to 7% damaged modules
- Level M (Medium): recovers up to 15% — most common default
- Level Q (Quartile): recovers up to 25%
- Level H (High): recovers up to 30% — used when logos overlay the code
Common use cases
QR codes exploded from industrial use to consumer use during the 2010s and especially 2020 as contactless interactions became essential. Common applications today include:
- URL encoding: the most common — scan camera, open link
- Payment: banking apps and mobile payment systems encode account details
- Wi-Fi credentials: WIFI:T:WPA;S:SSID;P:password;; format auto-connects scanners
- Contact information (vCard): phone, email, company — automatically imports
- App authentication: pair browser sessions to mobile app accounts
- Event tickets and boarding passes
- Menus and product information in restaurants and retail
Best practices for reliable scanning
QR codes that don’t scan reliably are worse than no QR code at all. The most common failure modes are predictable and preventable.
- Minimum physical size: 2×2 cm at 30 cm scan distance, scale up linearly for further distances
- Contrast: dark code on light background; inverted codes fail on many scanners
- Quiet zone: preserve at least 4 modules of white margin — not optional
- Print resolution: minimum 300 DPI for crisp modules
- Error correction: use level H when placing a logo; reserve <30% of the code area
- Test on multiple devices before final deployment
Security considerations
QR codes are inherently opaque to humans — you cannot read a destination URL until you scan. This makes them effective phishing vectors ("quishing"). Attackers print malicious QR codes over legitimate ones in public spaces, redirecting scans to lookalike login pages.
Scanning apps that preview the destination URL before opening are strongly preferred. For enterprise use, signed or enclosed QR codes (where the scanner validates a signature before acting) eliminate spoofing risk. Do not scan QR codes posted in untrusted locations without inspecting the resolved URL first.
Founder of UtilizAí, with a background in Blockchain, Cryptocurrencies and Finance in the Digital Era, plus complementary studies in Theology, Philosophy and ongoing coursework in Speech-Language Pathology. Learn more.
Frequently asked questions
How much data can a QR code hold?
Up to about 4,296 alphanumeric characters or 2,953 bytes at the largest version and lowest error-correction level. In practice, codes storing less than 200 characters are much easier to print and scan — typical URLs fit comfortably in small versions.
Can QR codes be damaged and still work?
Yes, that is the purpose of error correction. Level M (the common default) recovers from 15% damage. Level H recovers from 30% and is used when logos cover part of the code. The Reed-Solomon codes embedded in every QR regenerate missing data from redundancy.
Do QR codes expire?
The code itself never expires — it is a fixed pattern encoding fixed data. But if the data is a URL, the destination page may change or disappear. "Dynamic" QR codes used in marketing point to a redirect service, so the destination can be updated without reprinting the code.
Are QR codes safe to scan?
The code itself is just data. The risk lies in what the scanner does with the data — typically opening a URL. Modern smartphone scanners show the URL before opening, giving a chance to refuse suspicious destinations. Never scan codes from untrusted sources without inspecting the decoded content first.
Can I generate QR codes offline?
Yes. Open-source libraries exist in virtually every programming language (qrcode in Python, node-qrcode in JavaScript, zxing for multi-language support). The ISO 18004 algorithm is fully documented; no external service is required to produce valid QR codes.
Related guides
Understand password entropy, how cracking attacks actually work, why length beats complexity, and how to use passphrases and password managers effectively.
A practical guide to image compression: how JPEG, PNG, WebP, and AVIF work, lossy vs lossless, best use cases per format, and quality-size tradeoffs.
Understand PDF encryption: standard vs strong encryption, user vs owner passwords, common security flags, how redaction works, and real-world limits of PDF security.
Understand Base64 encoding: what problem it solves, the standard alphabet, padding rules, variants (URL-safe, MIME), performance tradeoffs, and common mistakes.