The team behind OnlineTools4Free — building free, private browser tools.
Published Feb 18, 2026 · 7 min read · Reviewed by OnlineTools4Free
How to Generate a QR Code: Complete Guide with Best Practices
What is a QR Code and How Does It Work?
A QR code (Quick Response code) is a two-dimensional barcode that stores data in a grid of black and white squares. Invented in 1994 by Denso Wave for tracking automotive parts, QR codes have become the standard way to bridge physical and digital worlds — from restaurant menus to payment systems.
Unlike traditional barcodes that store data in one dimension (horizontal lines), QR codes encode data both horizontally and vertically. This gives them much higher data capacity: a single QR code can store up to 4,296 alphanumeric characters or 7,089 numeric digits.
When you scan a QR code with your phone camera, the app detects the three large squares in the corners (finder patterns) to determine the code's orientation, then reads the data encoded in the grid pattern. The entire process takes milliseconds.
Types of QR Codes and What They Can Store
QR codes are surprisingly versatile. Here are the most common data types:
- URLs: The most common use. Scanning opens a web page directly in the browser. Use for linking to websites, landing pages, product pages, or any online resource.
- Wi-Fi credentials: Encodes network name, password, and encryption type. Scanning auto-connects the device — perfect for offices, cafes, and Airbnb properties.
- Contact information (vCard): Stores name, phone, email, address, and company info. Scanning adds the contact directly to the phone's address book.
- Email: Pre-fills the recipient, subject line, and body text. One scan opens the email compose screen ready to send.
- SMS: Pre-fills the phone number and message text.
- Plain text: Stores any text string. Useful for serial numbers, codes, or short messages.
- Calendar events: Encodes event details (title, date, time, location). Scanning adds the event to the phone calendar.
- Geolocation: Stores latitude and longitude coordinates. Scanning opens a map application with the location pinpointed.
You can create all of these with our QR Code Generator — just select the type, enter your data, and download the code.
How to Create a QR Code (Step-by-Step)
- Open our QR Code Generator.
- Select the data type (URL, Wi-Fi, vCard, text, etc.).
- Enter your content. For a URL, paste the full address including
https://. - Customize the appearance if desired: color, size, error correction level.
- Generate and download the QR code as PNG or SVG.
Use SVG for print materials (business cards, posters, packaging) because vector graphics scale to any size without pixelation. Use PNG for digital (email signatures, social media, websites) at a minimum of 300x300 pixels.
Design Best Practices
A QR code is useless if it cannot be scanned. Follow these guidelines for reliable performance:
Size and distance
The minimum scannable size depends on scanning distance. A common rule of thumb: the QR code should be at least 1/10th of the scanning distance. For a poster viewed from 2 meters away, the code should be at least 20 cm (8 inches) wide. For a business card scanned from 15 cm, the code can be as small as 1.5 cm.
Contrast and colors
QR scanners need strong contrast between the modules (squares) and the background. Dark modules on a light background works best. You can use colors other than black and white, but ensure a minimum contrast ratio of 4:1. Avoid light colors on light backgrounds or patterns behind the code.
Never invert a QR code (white modules on dark background) — most scanners cannot read inverted codes reliably.
Quiet zone
The blank margin around a QR code is called the quiet zone. It must be at least 4 modules wide on all sides. Without sufficient quiet zone, scanners may fail to detect the code boundaries. Do not crop the QR code or place other design elements too close to it.
Error correction
QR codes have built-in error correction at four levels:
- Level L (Low): Recovers 7% of data. Smallest code size.
- Level M (Medium): Recovers 15% of data. Good default.
- Level Q (Quartile): Recovers 25% of data.
- Level H (High): Recovers 30% of data. Largest code, but most damage-resistant. Required if you want to place a logo over the center.
For codes that will be printed on potentially damaged surfaces (product packaging, outdoor signage), use Level Q or H. For clean digital displays, Level M is sufficient.
Where to Place QR Codes Effectively
Placement determines whether your QR code gets scanned or ignored:
- Business cards: Link to your portfolio, LinkedIn profile, or vCard. Place on the back of the card where there is space.
- Product packaging: Link to instructions, warranty registration, or how-to videos. Place where customers can access it after purchase.
- Restaurant menus: Link to the digital menu. Place on table tents or stickers at each table.
- Event materials: Link to registration, schedule, or venue maps. Place on invitations, posters, and name badges.
- Real estate signs: Link to property listings with photos and details. Place at eye level on the sign.
- Retail displays: Link to product reviews, comparisons, or additional sizes/colors. Place near the product at arm's reach.
Where NOT to place QR codes: Billboards along highways (no time to scan), inside emails (the reader is already on a device — just use a link), on items behind glass that causes glare, or anywhere the code cannot be physically reached by a phone camera.
Testing and Tracking Your QR Codes
Before printing hundreds of copies, always test your QR code:
- Test on multiple devices. Scan with at least two different phones (iOS and Android) using the default camera app. Not all QR readers behave identically.
- Test at actual size. Print a test at the final dimensions and scan from the expected distance. A code that works on your screen may fail when printed small.
- Test on the actual material. Glossy surfaces cause reflections. Curved surfaces distort the code. Transparent materials reduce contrast. Test on the material you plan to use.
- Check the destination. Verify that the URL is correct and the landing page is mobile-friendly. A QR code that leads to a broken link or a desktop-only page is worse than no code at all.
For tracking how many people scan your code, use a URL shortener with analytics (like Bitly) as the destination URL. This gives you scan counts, geographic data, and device information without requiring any special QR code software.
Generate your QR code now with our QR Code Generator — it is free, instant, and runs entirely in your browser.
QR Code Generator
Generate QR codes for URLs, text, WiFi, and more. Download as PNG or SVG.
OnlineTools4Free Team
The OnlineTools4Free Team
We are a small team of developers and designers building free, privacy-first browser tools. Every tool on this platform runs entirely in your browser — your files never leave your device.
