QR Code Generator — Create Custom QR Codes Instantly

Generate QR codes for URLs, text, WiFi networks, or vCard contacts. Customize size, foreground and background colors, and error correction level. Download as PNG. Runs entirely in your browser — no data is sent anywhere.

QR Code Generator

L 7%
M 15%
Q 25%
H 30%

Higher levels restore more data if the QR code is damaged, but result in a denser pattern.

Your QR code will
appear here

How QR Codes Work

Structure of a QR Code

A QR (Quick Response) code is a 2D matrix barcode that encodes data as a grid of black and white modules (square dots). Unlike 1D barcodes that store data horizontally only, QR codes store data in both dimensions, allowing them to hold significantly more information in a compact space — up to 7,089 numeric characters or 4,296 alphanumeric characters in a single code.

Every QR code has fixed structural elements regardless of version. The three large square patterns in the corners (finder patterns) allow scanners to detect the code's position and orientation even when photographed at an angle. The smaller square in the alignment area helps correct perspective distortion on larger codes. Timing patterns (alternating black and white modules) establish the module size and grid. Format information strips carry the error correction level and mask pattern. All remaining modules carry encoded data and error correction codewords.

Encoding Process

Encoding data into a QR code involves several stages. First, the data is analyzed to select the most efficient encoding mode: numeric (digits only, 3.3 bits/char), alphanumeric (uppercase + symbols, 5.5 bits/char), byte (any ISO-8859-1 character, 8 bits/char), or kanji (Japanese characters, 13 bits/char). The selected encoding mode with the optimal version (size) is determined by the data length and required error correction level.

Second, the data is encoded into binary codewords and padded to fill the version's data capacity. Third, error correction codewords are computed using Reed-Solomon codes and interleaved with data codewords. Fourth, the complete codeword sequence is placed into the matrix using a specific zigzag path that avoids functional patterns. Finally, eight different mask patterns are evaluated and the one that produces the best score (most balanced distribution of dark and light modules) is applied to prevent patterns that could confuse scanners.

The JavaScript Implementation

This tool implements the full QR code generation algorithm in pure JavaScript, with no external libraries. The encoder handles byte mode encoding for maximum compatibility, supports all four error correction levels, computes Reed-Solomon error correction codewords, and applies all eight mask patterns to select the optimal one. The result is drawn on an HTML5 Canvas element with your chosen colors and size, then exported as a PNG for download.

Error Correction Levels Explained

Why QR Codes Can Be Damaged and Still Work

One of the most impressive properties of QR codes is their ability to be partially obscured, damaged, or dirty and still scan correctly. This is achieved through Reed-Solomon error correction, a mathematical technique used in CDs, DVDs, RAID storage, and space communications. Reed-Solomon adds redundant mathematical data to the code such that a scanner can reconstruct the original data even if portions of the code are unreadable.

The Four Levels

Level L (Low, ~7% recovery): The minimum error correction. Produces the smallest, least dense QR code for a given amount of data. Best used in clean digital environments where damage is unlikely — website links displayed on screens, presentations, or digital ads. If you are adding a logo overlay to a QR code, L is not recommended as the logo itself is "damage" the scanner must recover from.

Level M (Medium, ~15% recovery): The default for most applications. Good balance of code density and damage resistance. Suitable for print materials, business cards, and general use. A small logo can be overlaid in the center without preventing scanning.

Level Q (Quartile, ~25% recovery): Appropriate for industrial applications, product packaging, and any environment where the code might get dirty, scratched, or partially covered. Noticeably denser than M but still compact enough for practical use.

Level H (High, ~30% recovery): Maximum recovery. Required for codes that will be printed on materials subject to significant wear, embedded in packaging that may be torn, or when you want to overlay a large logo. The code will be denser and may require a slightly larger minimum print size for reliable scanning.

Choosing the Right Level

For digital-only use (screens, emails), Level M is sufficient. For print materials that will receive normal use, M or Q is appropriate. For outdoor signage, physical products, or codes with logo overlays, use H. Using a higher level than necessary increases code density and can make scanning harder in poor lighting — do not use H when M will do.

QR Code Use Cases and Formats

URL QR Codes

The most common type. Simply encode a full URL (including https://) to create a scannable link. Any modern smartphone camera can scan it and offer to open the URL in a browser without any dedicated app. Best practice: use a short URL (your own domain or a URL shortener) rather than a long URL with query parameters, as shorter URLs produce less dense, more scannable codes.

WiFi QR Codes

WiFi QR codes use a specific format: WIFI:T:WPA;S:SSID;P:password;;. When scanned, both iOS (13+) and Android (10+) automatically offer to connect to the network without typing credentials. Ideal for businesses, cafes, conference rooms, and guest networks. Note that WiFi passwords are encoded in plain text, so only post these codes in trusted environments — anyone who photographs the code has the credentials.

vCard Contact QR Codes

Encodes contact information in the vCard 3.0 format. When scanned, smartphones offer to add the contact to the address book. A single scan shares name, phone, email, organisation, and website simultaneously. Superior to NFC tags for contact sharing because no special hardware is needed — any camera app can read it. Excellent for business cards, name badges, and networking events.

Plain Text QR Codes

Encodes arbitrary text for display to the scanner. Use cases include short messages, product information, menu items with descriptions, instructions, and any information that does not map to a structured format. Scanners typically display the text directly.

Design and Printing Best Practices

Minimum Size Requirements

For reliable scanning in real-world conditions, QR codes should be printed at a minimum size of 2x2 cm (approximately 0.8 x 0.8 inches) for Level M at close scanning range (within 20 cm). For scanning at arm's length (40-60 cm), 3.5x3.5 cm is more reliable. For outdoor or long-distance scanning, scale up proportionally. The rule of thumb: scanning distance should be no more than 10x the code's width.

Contrast and Color

QR code scanners detect contrast between light and dark modules. Black on white provides the highest contrast and most reliable scanning. Color QR codes work as long as the foreground color is significantly darker than the background. Avoid similar tones (dark blue on dark red), metallic inks, or gradients that reduce local contrast. Always test color QR codes before printing at scale. Never invert the colors with a lighter foreground than background — most scanners expect dark modules on light background.

Quiet Zone

Every QR code specification requires a minimum quiet zone of 4 modules (blank margin) around all four sides. This is automatically included when you download from this tool. If you place the QR code in a document or on a page, ensure this quiet zone is preserved — placing content too close to the edges of a QR code will cause scan failures.

Logo Overlays

Logo overlays work because the error correction data can reconstruct the "obscured" modules. For a logo overlay, the logo should cover no more than 30% of the code area (for Level H), and should be centered. Test extensively — some scanner apps handle damaged codes better than others. Lower error correction levels should not have logo overlays; use Level H or at minimum Level Q.

Testing Before Distribution

Always scan your generated QR code before printing or publishing, using at least two different scanning apps or devices. Test in the actual environment — a code that scans perfectly on your desk may fail under fluorescent lighting, on glossy paper, or when photographed at an angle. For critical applications (product packaging, event tickets), test at the exact print size and substrate.

Frequently Asked Questions

Do QR codes expire?

QR codes themselves do not expire — they are just an image encoding data. Static QR codes (like those generated by this tool) will always encode exactly the data you put in. However, if the URL or content the code points to changes or becomes unavailable, the QR code will lead somewhere wrong or nowhere. For permanent QR codes, link to a URL you control. Dynamic QR codes (offered by some commercial services) let you change the destination URL after printing, but require a third-party service.

What is the maximum amount of data a QR code can hold?

A Version 40 QR code (the largest, 177x177 modules) can hold up to 7,089 numeric characters, 4,296 alphanumeric characters, 2,953 bytes of binary data, or 1,817 kanji characters at error correction level L. At level H, capacity drops to roughly 30% less. In practice, keeping data under 300 characters produces compact, easily scannable codes. Very long URLs or full vCards with all fields produce large, dense codes that may be harder to scan at small print sizes.

Is it safe to use a QR code generator that processes data in the browser?

Yes — it is actually more private than server-based generators. When you use this tool, your WiFi password, phone number, email address, and other personal data stays entirely in your browser. A server-based QR generator receives and potentially logs everything you encode. With this tool, no data is transmitted anywhere. You can verify by turning off your internet connection after the page loads — the tool continues to work perfectly because it requires no server communication.

Can I add a logo to the center of the QR code?

This tool does not include a built-in logo overlay feature. You can add a logo manually in any image editor after downloading: open the PNG, place your logo centered over the QR code, covering no more than 25-30% of the code area. Make sure you generated the QR code at error correction level H before doing this, which gives you up to 30% damage recovery. Test that the resulting code still scans reliably.

Why does increasing error correction make the QR code look more complex?

Higher error correction levels add more redundant data codewords. For the same input, a Level H code contains significantly more binary data than a Level L code because it includes enough redundancy to reconstruct 30% of damaged modules. More data requires a higher QR version (larger grid), and a larger grid with more modules looks denser and more complex. For URLs and short text, the visual difference between L and H is modest. For longer text or vCards, the size difference can be substantial.

ML
Michael Lip
Written on May 28, 2026 —