How QR Codes Work
A QR (Quick Response) code is a two-dimensional barcode that encodes data in a grid of black and white squares called modules. Unlike a traditional barcode which stores data in one dimension (horizontal lines), a QR code stores data in both rows and columns, allowing it to hold significantly more information.
Every QR code contains several fixed structural elements:
- Finder patterns: The three large squares in the corners help scanners detect the code and determine its orientation, regardless of the scanning angle.
- Alignment patterns: Smaller squares (in larger QR codes) help correct for perspective distortion when scanning at an angle.
- Timing patterns: Alternating black and white modules between finder patterns that establish the grid coordinates.
- Format information: Encodes the error correction level and mask pattern used.
- Data and error correction: The remaining modules store the actual payload and Reed-Solomon error correction codes.
When a camera scans a QR code, the software locates the three finder patterns, determines the code's size and orientation, reads the format information, then decodes the data modules while using error correction to fix any unreadable parts.
QR Code Data Types
QR codes can encode different types of data using standardized prefixes. The scanning device reads the prefix and takes the appropriate action (open a URL, connect to WiFi, compose an email, etc.).
| Type | Encoded Format | Use Case |
|---|---|---|
| URL | https://example.com |
Open a website link |
| Plain text | Any text string |
Display a message, note, or code snippet |
| WiFi | WIFI:T:WPA;S:name;P:pass;; |
Connect to a WiFi network automatically |
mailto:[email protected]?subject=... |
Open an email compose window with pre-filled fields | |
| SMS | smsto:+1234567890:message |
Open a text message with pre-filled recipient and message |
| Phone | tel:+1234567890 |
Initiate a phone call |
| vCard | BEGIN:VCARD...END:VCARD |
Save contact information (name, phone, email, address) |
| Geo location | geo:40.7128,-74.0060 |
Open a map at specific coordinates |
WiFi QR codes are widely supported on iOS (11+) and Android (10+). Scanning the code connects the device to the network without typing the password.
Error Correction Levels
QR codes use Reed-Solomon error correction to allow recovery of data even when part of the code is damaged, dirty, or obscured. Four levels are available:
| Level | Recovery | Best For | Trade-off |
|---|---|---|---|
| L (Low) | ~7% | Clean digital displays, short URLs | Smallest code size for the same data |
| M (Medium) | ~15% | General use -- good default for most applications | Balanced size and resilience |
| Q (Quartile) | ~25% | Printed materials that may get scuffed or folded | Noticeably denser code |
| H (High) | ~30% | Codes with logos overlaid, harsh environments | Largest code size for the same data |
Choosing the right level: Use M for most cases. Use H if you plan to place a logo over the center of the code. Use L if you need to encode a lot of data and the code will be displayed on a clean screen.
QR Code Data Capacity
The maximum amount of data a QR code can hold depends on the type of characters and the error correction level. These are the limits at the lowest error correction (Level L):
| Data Type | Max Characters (Level L) | Max Characters (Level H) | Examples |
|---|---|---|---|
| Numeric only | 7,089 | 3,057 | Phone numbers, IDs |
| Alphanumeric | 4,296 | 1,852 | URLs, codes (0-9, A-Z, space, $%*+-./: ) |
| Binary (bytes) | 2,953 | 1,273 | UTF-8 text, arbitrary data |
Practical advice: Keep data under 100-300 characters for a QR code that prints well at small sizes. More data means more modules, which means the code needs to be larger to remain scannable.
Best Practices
[+] Maintain High Contrast
Use a dark foreground on a light background. Black on white is the most reliable. Avoid low-contrast pairs like light gray on white or pastel-on-pastel -- scanners need clear edges.
[+] Size for Scanning Distance
Rule of thumb: QR code width = scanning distance / 10. For a poster scanned from 1 meter, the code should be at least 10 cm wide. Minimum 2 cm for close-range scanning.
[+] Use SVG for Print
SVG files are vector-based and scale to any size without pixelation. Use SVG for business cards, posters, packaging, and anything that will be resized. Use PNG for screens and digital use.
[+] Test Before Deploying
Scan your QR code with at least 2-3 different devices before printing or publishing. Test at the expected scanning distance and lighting conditions.
[+] Keep Data Short
Shorter data creates fewer modules, which means easier scanning. Use URL shorteners for long links if needed. A 20-character URL produces a much more scannable code than a 200-character one.
[+] Add a Quiet Zone
Leave white space (at least 4 modules wide) around the QR code. This "quiet zone" helps scanners distinguish the code from its surroundings.
[-] Avoid Inverting Colors
White modules on a black background (inverted) may not scan reliably on all devices, especially older smartphones. Some scanners expect dark-on-light orientation.
[-] Avoid Excessive Decoration
Overlaying large logos, applying rounded corners to modules, or adding heavy styling can interfere with scanning. If you use a logo, keep it under 10-15% of the code area and use error correction level H.
Common Mistakes
- Encoding too much data: Pasting an entire paragraph or long URL makes the QR code extremely dense. Dense codes need to be printed larger and are harder to scan. Shorten the content or use a URL shortener.
- Low contrast colors: A red code on an orange background might look nice but scanners struggle with it. Always ensure the foreground is significantly darker than the background.
- Printing too small: A QR code that looks fine on your monitor can be unreadable when printed at 1 cm wide. Test at the intended print size.
- No quiet zone: Placing the QR code edge-to-edge against other design elements or a colored border can confuse scanners. Leave white space around all four sides.
- Linking to non-mobile-friendly pages: Most QR code scans happen on smartphones. If the destination URL is not mobile-friendly, users will leave immediately.
- Not testing the code: Always scan your QR code before printing 10,000 business cards. Test with multiple devices, at the expected distance, in the expected lighting.
- Confusing static and dynamic codes: Codes from this tool are static -- the data is baked into the pattern. You cannot change where the code points after printing. Plan your URLs accordingly.
Static vs. Dynamic QR Codes
There are two categories of QR codes:
- Static QR codes encode data directly into the pattern. They never expire, work offline, and do not depend on any third-party service. The data cannot be changed after the code is created. This tool generates static QR codes.
- Dynamic QR codes encode a short redirect URL that points to a tracking service. The service operator can change the destination URL, track scan counts, and analyze scan locations. They stop working if the service goes offline or the subscription expires.
For personal use, WiFi sharing, and stable URLs, static codes are ideal. Dynamic codes are useful when you need analytics or the ability to change the destination after printing.
PNG vs. SVG: Which Format to Download
| Feature | PNG | SVG |
|---|---|---|
| Format type | Raster (pixels) | Vector (paths) |
| Scaling | Gets blurry if enlarged | Scales to any size without loss |
| Best for | Websites, social media, email | Print materials, large displays, packaging |
| File size | Larger (especially at high resolution) | Smaller (text-based) |
| Editable | Image editors only | Any text or vector editor |
Rule of thumb: Use SVG for anything that will be printed or resized. Use PNG for quick digital sharing.
Frequently Asked Questions
What is a QR code?
A QR (Quick Response) code is a two-dimensional barcode that stores data in a grid of black and white squares. Unlike traditional barcodes that hold up to about 25 characters, QR codes can store over 4,000 alphanumeric characters. They were invented in 1994 by Denso Wave for tracking automotive parts and are now used worldwide for links, payments, WiFi sharing, and more.
How do I create a QR code for free?
Enter your URL, text, WiFi credentials, or other data into the generator above, select your preferred size and error correction level, then download the result as PNG or SVG. This generator runs entirely in your browser -- no sign-up, no watermarks, and no data is sent to any server.
What data types can a QR code store?
QR codes can encode plain text, URLs, WiFi network credentials (SSID, password, security type), email addresses with optional subject and body, phone numbers, SMS messages, vCard contact information, calendar events, and geographic coordinates. The data type is determined by a prefix in the encoded string that tells the scanning device what action to take.
What is QR code error correction?
Error correction allows a QR code to be read even if part of it is damaged, dirty, or obscured. QR codes use Reed-Solomon error correction with four levels: L (recovers ~7% of data), M (~15%), Q (~25%), and H (~30%). Higher levels add more redundancy, which makes the QR code denser for the same amount of data. Use M for most cases; use H if you plan to place a logo over part of the code.
What size should a QR code be for printing?
The minimum recommended size is 2 x 2 cm (about 0.8 x 0.8 inches) for scanning within arm's reach. A general rule: the QR code width should be at least 1/10th of the expected scanning distance. For a poster read from 1 meter away, the code should be at least 10 cm wide. For a billboard at 5 meters, at least 50 cm. Always test with real devices at the intended distance before printing.
Can I customize the colors of a QR code?
Yes. You can change both the foreground (module) color and the background color. The essential requirement is contrast -- the foreground must be significantly darker than the background. Avoid light-on-light or dark-on-dark combinations. Black on white provides the best reliability across all scanners.
What is the difference between PNG and SVG for QR codes?
PNG is a pixel-based (raster) format. It works well for digital use but gets blurry when scaled up. SVG is a vector format that remains sharp at any size, making it the better choice for print materials like business cards, posters, and packaging. Download SVG whenever the code will be resized or printed at high quality.
Do QR codes expire?
Static QR codes (like those from this tool) never expire. The data is encoded directly in the pattern and does not depend on any external service. However, if the code points to a URL that later stops working, the code still functions -- it just leads to a dead link. Dynamic QR codes from paid services can expire when the subscription lapses.
How much data can a QR code hold?
At the lowest error correction (Level L), a QR code can hold up to 7,089 numeric digits, 4,296 alphanumeric characters, or 2,953 bytes of binary data. In practice, keep data under 100-300 characters for a code that scans easily at small sizes. More data means more modules and a larger required print size.
Can I put a logo in the center of a QR code?
Yes, if you use high error correction (Level H, ~30% recovery). The logo covers some data modules, and error correction compensates for the missing data. Keep the logo under 10-15% of the code area and test thoroughly with multiple devices. This tool does not add logos automatically, but you can overlay one in an image editor after downloading.
Why won't my phone scan my QR code?
Common causes: insufficient contrast between colors, the code is too small for the scanning distance, the image is blurry or low-resolution, glare from a reflective surface, or the encoded data is too long (making the code too dense). Try increasing the size, using black on white, raising the error correction level, and reducing the data length.
Does this QR code generator store my data?
No. All QR code generation runs entirely in your browser using JavaScript. Your text, URLs, WiFi passwords, and other inputs are never sent to any server. No cookies are set, no analytics track your input. You can verify this by disconnecting from the internet -- the tool works identically offline after the page loads.
Related Tools
- QR Code Scanner -- scan and decode QR codes from images or your camera
- Barcode Generator -- create traditional 1D barcodes (Code 128, EAN, UPC)
- URL Encoder/Decoder -- encode special characters in URLs before generating QR codes
- Password Generator -- create strong WiFi passwords to encode in QR codes
- How QR Codes Work -- complete guide to QR code structure, data encoding, and best practices
Privacy & Limitations
- Client-side only. No data is sent to any server. No cookies, no tracking of entered text, URLs, or WiFi passwords.
- Static codes only. This tool generates static QR codes. The data is encoded directly in the pattern and cannot be changed after creation. For analytics or editable destinations, use a dynamic QR code service.
- No logo overlay. This tool does not embed logos into QR codes. You can add a logo manually using an image editor after downloading the code -- use error correction level H if you do.
- Data capacity. Very long inputs (over ~2,000 characters) may produce codes that are too dense to scan reliably at small sizes. Keep data concise for best results.
- Color contrast. Custom colors can reduce scanability. The tool does not validate contrast -- always test custom-colored codes with multiple devices before printing.
Related Tools
View all toolsSquare Footage Calculator
Calculate area in square feet from room dimensions for flooring, painting, and more
Tip Calculator
Calculate tip amount, total, and per-person split
Online Compass
Digital compass using your device's magnetometer sensor
Split Bill Calculator
Split a total evenly across a group
Receipt Total Calculator
Add line items, tax, discounts, tip, and split totals instantly
Shopping List Builder
Build a smart shopping list with quantities, categories, and budget tracking
QR Code Generator FAQ
What is a QR code?
A QR (Quick Response) code is a two-dimensional barcode that stores data in a grid of black and white squares. Unlike traditional barcodes that hold up to ~25 characters, QR codes can store over 4,000 alphanumeric characters. They are designed to be scanned quickly by smartphone cameras and dedicated readers.
How do I create a QR code for free?
Enter your URL, text, WiFi credentials, or other data into a QR code generator, select your preferred size and error correction level, then download the result as PNG or SVG. This generator runs entirely in your browser -- no sign-up, no watermarks, and no data is sent to any server.
What data types can a QR code store?
QR codes can encode plain text, URLs, WiFi network credentials (SSID, password, security type), email addresses (with optional subject and body), phone numbers, SMS messages, vCard contact information, calendar events, and geographic coordinates. The data type is determined by a prefix in the encoded string.
What is QR code error correction?
Error correction allows a QR code to be read even if part of it is damaged or obscured. QR codes use Reed-Solomon error correction with four levels: L (7% recovery), M (15%), Q (25%), and H (30%). Higher levels increase redundancy but make the QR code denser for the same data. Use level M for most cases, and level H if you plan to place a logo over part of the code.
What size should a QR code be for printing?
The minimum recommended print size is 2 x 2 cm (about 0.8 x 0.8 inches) for close-range scanning (within 25 cm). A general rule is that the scanning distance is roughly 10 times the QR code width. For a poster scanned from 1 meter away, the code should be at least 10 cm wide. Always test with multiple devices before printing.
Can I customize the colors of a QR code?
Yes, you can change both the foreground (dark modules) and background colors. The key requirement is sufficient contrast -- the foreground must be darker than the background. Avoid low-contrast combinations like yellow on white or light gray on white, as scanners may fail to read them. Standard black on white offers the best reliability.
What is the difference between PNG and SVG for QR codes?
PNG is a raster (pixel-based) format -- good for digital use and small prints. SVG is a vector format that scales to any size without losing sharpness, making it ideal for print materials like posters, business cards, and packaging. Use SVG whenever the QR code will be resized or printed at large dimensions.
Do QR codes expire?
Static QR codes (like those generated by this tool) never expire. The data is encoded directly in the pattern and does not depend on any external service. However, if a QR code points to a URL that stops working, the code itself still works -- it just leads to a dead link. Dynamic QR codes from commercial services can expire if the service is discontinued.
How much data can a QR code hold?
The maximum capacity depends on the data type and error correction level. At the lowest error correction (L), a QR code can hold up to 7,089 numeric digits, 4,296 alphanumeric characters, or 2,953 bytes of binary data. In practice, keeping data under 100-300 characters produces a scannable code at reasonable sizes.
Can I put a logo in the center of a QR code?
Yes, if you use high error correction (level H, 30% recovery). The logo covers some modules, and error correction compensates for the missing data. Keep the logo to no more than 10-15% of the code area and test thoroughly. This tool does not add logos automatically, but you can overlay one in an image editor after downloading the QR code.
Why won't my phone scan my QR code?
Common reasons include: insufficient contrast between foreground and background colors, the code is too small for the scanning distance, the image is blurry or low-resolution, the code is printed on a reflective surface causing glare, or the encoded data exceeds the QR code capacity. Try increasing the size, using black on white, and raising the error correction level.
Does this QR code generator store my data?
No. All QR code generation runs entirely in your browser using JavaScript. Your text, URLs, WiFi passwords, and other inputs are never sent to any server. You can verify this by disconnecting from the internet -- the tool works identically offline after the page loads.