QR Code Generator
Create custom QR codes for URLs, text, WiFi, contacts, and more. Customize colors and download in high resolution.
// npm install qrcodeimport QRCode from 'qrcode';// Generate as data URLconst dataUrl = await QRCode.toDataURL('https://example.com');// Generate as SVG stringconst svg = await QRCode.toString('https://example.com', { type: 'svg' });// Generate to canvasawait QRCode.toCanvas(document.getElementById('canvas'), 'text');
You May Also Like
What is a QR Code?
A QR Code (Quick Response Code) is a two-dimensional barcode that can store much more information than traditional barcodes. Originally invented in 1994 by a Japanese company (Denso Wave) to track car parts, QR codes are now everywhere!
Why "Quick Response"? The name comes from its ability to be decoded quickly - up to 10x faster than traditional barcodes.
What can you store in a QR code?
- URLs (most common)
- WiFi credentials (auto-connect!)
- Contact information (vCard)
- Email addresses and messages
- Phone numbers
- Plain text
- And much more...
How QR Codes Work
The Anatomy of a QR Code
┌─────────────────────┐
│ ▓▓▓ ▓▓▓ ▓▓▓▓▓▓ │ ← Finder patterns (3 corners)
│ ▓ ▓ ▓ ▓ ▓ ▓ │
│ ▓▓▓ ▓▓▓ ▓▓▓▓▓▓ │
│ │
│ ▓▓▓▓▓▓▓▓▓▓▓▓▓ │ ← Data and error correction
│ ▓░░░░░░░░░░░▓ │
│ ▓░░░░░░░░░░░▓ │
│ │
│ ▓▓▓ │ ← Alignment pattern
│ ▓ ▓ ▓▓▓▓▓▓▓▓▓▓▓ │
│ ▓▓▓ │
└─────────────────────┘
Key Components:
- Finder Patterns - The three big squares in corners help scanners locate and orient the code
- Alignment Pattern - Helps correct distortion when scanning at angles
- Timing Patterns - Alternating black/white modules that help determine grid size
- Data Area - Where your actual information is encoded
- Quiet Zone - White border around the code (essential!)
Error Correction Levels
QR codes have built-in redundancy, meaning they can still be read even if partially damaged!
| Level | Recovery | Best For |
|---|---|---|
| L (Low) | ~7% | Clean environments, maximum data |
| M (Medium) | ~15% | General purpose (recommended) |
| Q (Quartile) | ~25% | Industrial use, some wear expected |
| H (High) | ~30% | Harsh environments, logos in center |
Want to add a logo to your QR code? Use Level H error correction. This allows up to 30% of the code to be obscured while still being scannable!
QR Code Data Types
📶 WiFi Network
WIFI:T:WPA;S:MyNetwork;P:MyPassword;;
Scan to auto-connect - no more typing long passwords!
👤 Contact Card (vCard)
BEGIN:VCARD
VERSION:3.0
N:Smith;John
TEL:+1234567890
EMAIL:john@example.com
END:VCARD
Instantly add someone to your contacts.
mailto:hello@example.com?subject=Hello&body=Message
Pre-filled email ready to send.
📱 SMS
sms:+1234567890?body=Hello
Open messaging app with pre-written text.
📞 Phone Call
tel:+1234567890
One tap to dial.
QR Code Best Practices
✅ Do:
- Keep URLs short (use URL shorteners if needed)
- Test your QR code before printing
- Ensure adequate quiet zone (white border)
- Use high contrast colors (dark on light)
- Size appropriately for scanning distance
❌ Don't:
- Invert colors (white on black is harder to scan)
- Use low contrast color combinations
- Make it too small (minimum 2cm × 2cm for print)
- Stretch or distort the code
- Place on curved surfaces without testing
📏 Size Guidelines:
| Distance | Minimum Size |
|---|---|
| 10 cm (4 in) | 2 cm × 2 cm |
| 50 cm (20 in) | 5 cm × 5 cm |
| 1 m (3 ft) | 10 cm × 10 cm |
| 5 m (16 ft) | 50 cm × 50 cm |
QR Code Security
Security Alert: QR codes can contain malicious URLs! Always check the URL before visiting, especially for codes found in public places.
Common QR Code Scams:
- QR Code Stickers - Scammers place fake codes over legitimate ones
- Phishing - Codes linking to fake login pages
- Malware - Links to malicious downloads
- Payment Fraud - Redirecting payments to scammer accounts
Stay Safe:
- Use a QR scanner that previews URLs before opening
- Be suspicious of codes in unexpected places
- Verify the domain before entering credentials
- When in doubt, type the URL manually
Fun QR Code Facts
🏎️ Racing Origins QR codes were invented by Denso Wave to track car parts in manufacturing. They needed something faster than barcodes!
🆓 Patent-Free Denso Wave chose not to exercise their patent rights, making QR codes free to use worldwide. This openness drove massive adoption.
📊 Capacity A single QR code can store:
- 7,089 numeric characters
- 4,296 alphanumeric characters
- 2,953 bytes of binary data
🎨 Colors Work (Sometimes) QR codes don't have to be black and white, but darker colors must contrast with lighter colors. Blue on white works; yellow on white doesn't!
📱 COVID Boost QR code usage exploded during the pandemic for contactless menus, check-ins, and vaccine passports. Usage increased 96% in 2020!