QR Codes Explained: How They Work and How to Generate Them
QR Codes Explained: How They Work and How to Generate Them
QR codes are everywhere — restaurant menus, product packaging, business cards, event tickets, parking meters, and museum exhibits. In 2020, when physical menus became a hygiene concern, QR codes went from niche to ubiquitous almost overnight. Yet most people who scan them daily have no idea how they store data or why they can be partially torn or obscured and still scan successfully.
This guide explains the technology behind QR codes from the inside out, covers every important use case, and shows you how to generate a QR code for any URL, text, or contact card in seconds.
What Is a QR Code?
QR stands for Quick Response. The format was invented in 1994 by Masahiro Hara at Denso Wave, a subsidiary of Toyota, to track automobile parts during manufacturing. It was designed to be scanned quickly and to store far more data than a traditional 1D barcode.
A QR code is a two-dimensional matrix barcode — a square grid of black and white modules (pixels) that encode data as a pattern. Unlike a 1D barcode (the stripes on a grocery product) which encodes data along one axis, a QR code encodes data along both horizontal and vertical axes, allowing it to store significantly more information.
Anatomy of a QR Code
A standard QR code has several distinct structural elements:
Finder Patterns: The three large squares in the top-left, top-right, and bottom-left corners. These allow QR scanners to detect the code's position, size, and orientation regardless of angle. This is why you can scan a QR code held sideways or upside down.
Alignment Pattern: A smaller square in the lower-right area. It helps scanners correct for distortion when the code is printed on a curved surface.
Timing Pattern: The alternating black and white pattern running between the finder patterns. It establishes the module grid size.
Format Information: Strips adjacent to the finder patterns that encode the error correction level and mask pattern used.
Data Modules: The remaining cells encode the actual data and error correction information.
Quiet Zone: A white border around the entire code that helps scanners distinguish the code from surrounding content.
How Data Is Encoded
QR codes support four encoding modes, chosen based on the content type:
Numeric mode: Stores only digits 0–9. Most compact — encodes 3 digits per 10 bits.
Alphanumeric mode: Stores uppercase letters, digits, and a small set of symbols (space, $, %, *, +, -, ., /, :). Encodes 2 characters per 11 bits.
Byte mode: Stores any byte value (typically UTF-8 text). Encodes 1 character per 8 bits. Used for URLs, lowercase text, and international characters.
Kanji mode: Stores Japanese Shift JIS characters (double-byte). Optimized for Japanese text.
A URL like https://universalwebtoolkit.com would be encoded in byte mode, allowing the full character set including lowercase letters and the / slash.
QR Code Versions
QR codes come in 40 versions (sizes), ranging from Version 1 (21×21 modules) to Version 40 (177×177 modules). Each larger version stores more data:
- Version 1: Up to 41 numeric characters or 17 alphanumeric characters
- Version 10: Up to 652 numeric characters or 395 alphanumeric characters
- Version 40: Up to 7,089 numeric characters or 4,296 alphanumeric characters
The QR code generator chooses the smallest version that fits your data. This is why a long URL generates a denser, more complex code than a short URL.
Error Correction: Why Damaged QR Codes Still Scan
One of the QR code's most impressive features is its ability to be read even when partially obscured, dirty, or damaged. This is achieved through Reed-Solomon error correction, originally developed for space communication where signal corruption is unavoidable.
QR codes support four error correction levels:
| Level | Can Restore | Best Used For |
|---|---|---|
| L (Low) | 7% of data | Clean environments, small codes |
| M (Medium) | 15% of data | General purpose (default) |
| Q (Quartile) | 25% of data | Environments where damage is likely |
| H (High) | 30% of data | Artistic/logo QR codes |
Higher error correction makes the code denser (because redundancy data takes up space) but more resilient. When you see a QR code with a logo embedded in the center, the designer chose Level H error correction so the code can still scan despite the logo covering part of the data area.
Real-World Use Cases
Restaurant Menus and Hospitality
Post-pandemic, QR menus became standard in restaurants worldwide. A single QR code linked to a Google Drive, Notion page, or website allows menus to be updated instantly without reprinting physical copies.
Business Cards and Networking
Encode your vCard (contact information) in a QR code for your business card. A scan instantly adds your name, phone, email, website, and company to the recipient's contacts — no manual typing.
Product Packaging and Authentication
Manufacturers use QR codes to link to product manuals, ingredient lists, origin stories, and authentication portals. High-end brands encode unique serial numbers to allow consumers to verify product authenticity.
Event Tickets
Event organizers generate unique QR codes per ticket that staff scan at the entrance. This eliminates paper tickets and makes it easy to invalidate a code if a ticket is reported stolen.
WiFi Sharing
A QR code can encode WiFi credentials. Guests scan the code and join the network without typing a password. Format: WIFI:T:WPA;S:NetworkName;P:Password;;
Payment Systems
WeChat Pay, Alipay, and many banking apps use QR codes for peer-to-peer payments and retail transactions. The merchant displays a QR code; the customer scans and pays.
Marketing Campaigns
Print QR codes on flyers, billboards, and packaging to link offline marketing materials to online destinations — product pages, video demos, special offers, or app download pages.
Generating a QR Code
Our QR Code Generator creates QR codes for any text or URL instantly in your browser. No account, no watermark, no upload required:
- Enter your URL, text, WiFi details, or contact information
- Choose your preferred size and error correction level
- Download the QR code as a PNG or SVG
The PNG format is ideal for printing; SVG scales to any size without pixelation, making it perfect for large-format printing on banners and signage.
Best Practices for QR Code Design
Minimum size: QR codes should be at least 2.5 cm × 2.5 cm (1 inch × 1 inch) for reliable scanning on mobile devices. Larger is better for codes displayed at a distance.
Contrast: Black modules on a white background is standard. Inverted (white on dark) can work but must have strong contrast. Avoid low-contrast color combinations.
Testing: Always test your QR code with multiple devices and apps before publishing. Different scanning apps handle edge cases differently.
Short URLs: Long URLs create dense, complex QR codes that can be harder to scan. Use a URL shortener or a custom domain for marketing QR codes.
Landing page mobile optimization: Since QR codes are scanned on phones, always ensure the destination URL is mobile-friendly.
Summary
QR codes are a mature, versatile technology with applications spanning hospitality, logistics, marketing, payments, and security. Understanding their structure helps you make better decisions about error correction levels, code density, and design constraints.
Key takeaways:
- QR codes encode data in a 2D matrix of modules across 40 versions (sizes)
- Error correction levels allow codes to scan even when 7–30% of the surface is damaged
- Higher error correction = denser code, but allows logos and design overlays
- Common uses: menus, business cards, tickets, WiFi sharing, product authentication
- Generate QR codes instantly — no account needed — with the QR Code Generator