What Is a QR Code?
A QR code (Quick Response code) is a two-dimensional barcode that stores data in a grid of black and white squares called modules. Invented in 1994 by Denso Wave, a subsidiary of Toyota, QR codes were originally designed to track automotive parts on assembly lines. Today, they are ubiquitous — used for everything from restaurant menus and payment systems to boarding passes and marketing campaigns.
Unlike traditional one-dimensional barcodes that store data in a single direction, QR codes encode data both horizontally and vertically. This allows them to store significantly more information in a smaller area. A single QR code can hold up to 7,089 numeric characters, 4,296 alphanumeric characters, or 2,953 bytes of binary data.
How QR Codes Work
A QR code encodes data through several layers of processing:
- Data encoding — The input text is converted into a binary bit stream using one of four modes: numeric (digits only), alphanumeric (uppercase letters, digits, and a few symbols), byte (any UTF-8 data), or kanji. The mode determines how efficiently the data is packed.
- Error correction — Reed-Solomon error correction codewords are appended to the data. These redundant codewords allow the QR code to be read even if parts of it are damaged, obscured, or dirty.
- Structure placement — The encoded data is placed into a matrix alongside structural elements: finder patterns (the three large squares in the corners), timing patterns (alternating modules that help the scanner determine grid coordinates), and alignment patterns (smaller squares that correct for perspective distortion).
- Masking — A mask pattern is applied to the data region to avoid large areas of uniform color that could confuse scanners. The encoder tries all eight standard masks and selects the one that produces the most balanced, scannable result.
- Format information — Metadata about the error correction level and mask pattern is encoded into reserved areas of the matrix, allowing the decoder to interpret the QR code correctly.
QR Code Versions and Capacity
QR codes come in 40 versions, numbered 1 through 40. Each version adds four modules per side to the matrix: version 1 is 21×21 modules, version 2 is 25×25, and version 40 is 177×177. Higher versions can store more data but produce larger, denser codes.
For most practical purposes (URLs, short text, contact information), versions 1-10 are sufficient. This tool supports versions 1-10, which can encode up to approximately 271 bytes of data at the lowest error correction level. That is enough for virtually any URL, Wi-Fi configuration, or short text message.
The version is automatically selected based on the data length and error correction level. The encoder always chooses the smallest version that can accommodate the data, keeping the QR code as compact as possible.
Error Correction Levels Explained
QR codes use Reed-Solomon error correction to recover data even when parts of the code are damaged. There are four error correction levels:
- L (Low) — Can recover approximately 7% of data codewords. Best for clean, digital environments where the QR code will not be physically damaged.
- M (Medium) — Can recover approximately 15% of data codewords. The default choice for most applications. Good balance between data capacity and resilience.
- Q (Quartile) — Can recover approximately 25% of data codewords. Suitable for printed QR codes that may suffer moderate wear.
- H (High) — Can recover approximately 30% of data codewords. Use this when the QR code will be printed on surfaces prone to damage, or when you plan to place a logo over part of the code.
Higher error correction levels consume more of the code’s capacity for redundancy, leaving less room for actual data. For the same data, a QR code with level H will be larger (higher version) than one with level L.
QR Codes in Marketing and Payments
QR codes have become a cornerstone of modern marketing and payment systems. Their ability to bridge the physical and digital worlds makes them invaluable:
- Marketing — Print ads, product packaging, posters, and business cards use QR codes to link to websites, videos, social media profiles, and promotional offers. The user simply scans the code with their smartphone camera.
- Mobile payments — Systems like Alipay, WeChat Pay, PayPal, and Venmo use QR codes for peer-to-peer and merchant payments. The QR code encodes payment information that the app processes instantly.
- Authentication — Services like WhatsApp Web, Discord, and many two-factor authentication apps use QR codes to securely transfer session tokens or TOTP secrets from a phone to another device.
- Ticketing and boarding — Airlines, event venues, and transit systems use QR codes as digital tickets. The code contains a unique identifier that is validated at entry points.
QR Code Security Considerations
While QR codes themselves are simply data containers, they introduce security risks that users and businesses should be aware of:
- Phishing (QRishing) — Attackers can create QR codes that link to malicious websites designed to steal credentials or install malware. Always verify the URL before entering any sensitive information.
- QR code tampering — Physical QR codes can be overlaid with stickers containing malicious codes. This is common in public spaces like parking meters and restaurant tables.
- Data exfiltration — QR codes can encode URLs that include tracking parameters, collecting information about when and where the code was scanned.
Best practices for QR code security: use a scanner that previews the URL before opening it, avoid scanning codes from untrusted sources, and if you generate QR codes for your business, use HTTPS URLs and monitor for unauthorized modifications.
Dynamic vs. Static QR Codes
QR codes fall into two categories based on how their destination is managed:
- Static QR codes — The data (URL, text, etc.) is encoded directly in the QR code. Once generated, the content cannot be changed. This tool generates static QR codes. They are free, require no ongoing service, and work forever.
- Dynamic QR codes — The QR code points to a short URL controlled by a service. The destination can be changed without regenerating the code. Dynamic codes also enable scan analytics (count, location, device). They typically require a paid subscription service.
For most developer and personal use cases, static QR codes are sufficient. Dynamic codes are valuable for marketing campaigns where you need to update destinations or track engagement metrics.
QR Code Design Best Practices
To create QR codes that scan reliably across devices:
- Maintain adequate quiet zone — The white border around the QR code (quiet zone) must be at least 4 modules wide. This helps scanners identify the code boundaries.
- Ensure high contrast — Dark modules on a light background provides the best scan reliability. Avoid low- contrast color combinations.
- Use appropriate size — The minimum recommended print size is 2×2 cm (about 0.8×0.8 inches) for scanning at arm’s length. For billboards or signage, calculate the size based on scanning distance: roughly 10:1 ratio (1 cm QR code per 10 cm scanning distance).
- Test before deploying — Always test your QR code with multiple devices and scanning apps before printing or distributing. Different cameras and apps have varying decoding capabilities.
- Keep data minimal — Shorter data produces smaller, more reliable QR codes. Use URL shorteners for long URLs. Fewer modules means the code is easier to scan, especially from a distance.
- Choose the right error correction — If you plan to add a logo overlay, use level H (30% recovery). For clean digital displays, level M (15%) is usually sufficient.
How This Tool Works
This QR code generator runs entirely in your browser. No data is sent to any server. The QR code is generated using a pure JavaScript implementation of the QR code specification:
- Your input text is encoded in byte mode (UTF-8), which supports any character including Unicode.
- The smallest QR code version (1-10) that can hold your data at the selected error correction level is automatically chosen.
- Reed-Solomon error correction codewords are computed and interleaved with the data codewords.
- The data is placed into the QR matrix alongside finder patterns, timing patterns, and alignment patterns.
- All eight mask patterns are evaluated, and the one with the lowest penalty score (most scannable) is selected.
- The result is rendered as an SVG image, which can be downloaded directly or converted to PNG via the HTML5 Canvas API.
Frequently Asked Questions
Is this tool free to use?
Yes, completely free with no limits. The QR code is generated in your browser — no server processing, no account required, no watermarks.
Can I use the generated QR codes commercially?
Yes. QR codes are an open standard (ISO/IEC 18004). The codes generated by this tool are yours to use for any purpose — personal, commercial, or otherwise.
What is the maximum data I can encode?
This tool supports QR code versions 1-10. The maximum capacity depends on the error correction level: approximately 271 bytes with level L, 213 bytes with level M, 151 bytes with level Q, or 119 bytes with level H. This is sufficient for virtually any URL or short text.
Should I choose SVG or PNG for download?
SVG is vector-based and can be scaled to any size without losing quality. It is ideal for print media, signage, and any use case where you might resize the code. PNG is a raster format suitable for digital use at the specific resolution you generate. For maximum flexibility, download the SVG.
Which error correction level should I use?
For most digital use cases, M (Medium, 15%) is the best default. Use H (High, 30%) if you plan to add a logo over the code or if the code will be printed in environments where it might get damaged. Use L (Low, 7%) only when you need to minimize the QR code size and the code will be displayed on a clean digital screen.