QR codes are everywhere. Restaurant menus, event tickets, payment systems, WiFi sharing. But as developers, we often overlook how useful they can be in our own workflows.
Let's explore some practical use cases beyond "link to my website."
Quick Refresher: What's in a QR Code?
A QR code is just data encoded visually. It can hold:
- URLs (most common)
- Plain text (up to ~4,000 characters)
- WiFi credentials (SSID + password)
- Contact cards (vCard format)
- Calendar events (iCal format)
- Email/SMS templates
- Geolocation coordinates
The format determines what happens when scanned.
Developer Use Cases
1. WiFi Sharing for Guests/Coworkers
Instead of spelling out your office WiFi password:
WIFI:T:WPA;S:MyNetwork;P:SecretPassword123;;
Scan → connected. No typos.
2. Quick Environment Setup
Encode configuration URLs or setup commands:
https://myapp.dev/setup?token=abc123&env=staging
New team member? Scan to configure their dev environment.
3. Localhost Tunneling
Testing on mobile? Generate a QR code for your ngrok/localtunnel URL:
ngrok http 3000
# Copy the URL, generate QR, scan with phone
Faster than typing https://abc123.ngrok.io on mobile.
4. Deploy Previews
Add QR codes to your PR comments:
- Vercel/Netlify preview URL as QR
- Designers can scan and review on real devices
- No Slack link hunting
5. Conference Badges
Build a simple badge generator:
- Encode vCard with name, email, LinkedIn
- Attendees scan each other's badges
- No manual contact entry
6. Debug Information
Encode error details for support:
{"error":"AUTH_FAILED","userId":"12345","timestamp":1710000000}
User scans → sends you structured debug data.
Generating QR Codes
JavaScript (Browser)
// Using qrcode library
import QRCode from 'qrcode';
const canvas = document.getElementById('qr');
QRCode.toCanvas(canvas, 'https://example.com');
JavaScript (Node.js)
const QRCode = require('qrcode');
// To file
QRCode.toFile('./qr.png', 'https://example.com');
// To data URL
const dataUrl = await QRCode.toDataURL('https://example.com');
Python
import qrcode
qr = qrcode.make('https://example.com')
qr.save('qr.png')
Command Line
# macOS (with Homebrew)
brew install qrencode
qrencode -o qr.png 'https://example.com'
# Or use an online tool
Free QR Generator
For quick one-off QR codes without writing code:
QRCreator.site — Simple, free, no signup required.
Supports:
- URLs
- Plain text
- WiFi credentials
- vCards
- Download as PNG
Best Practices
1. Add Error Correction
QR codes have built-in redundancy. Higher error correction = more scannable even if partially obscured.
QRCode.toCanvas(canvas, url, {
errorCorrectionLevel: 'H' // L, M, Q, H (7%, 15%, 25%, 30%)
});
2. Mind the Size
- Minimum: 2cm × 2cm for reliable scanning
- Distance rule: 10:1 ratio (10cm away = 1cm QR minimum)
- Test on multiple devices before printing
3. Use Short URLs
More data = denser QR = harder to scan.
❌ https://example.com/products/category/subcategory/item?ref=campaign&utm_source=qr
✅ https://example.com/p/abc123
Or use a URL shortener with analytics.
4. Add a Frame/Label
Users don't know what a random QR does. Add context:
┌─────────────┐
│ [QR] │
│ │
│ Scan for │
│ WiFi access │
└─────────────┘
5. Test Before Deploying
Always scan your QR with:
- iPhone camera
- Android camera
- At least one QR scanner app
Different readers have different quirks.
Dynamic QR Codes
Static QR = fixed content. Dynamic QR = redirect through your server.
Static: QR → https://example.com/menu.pdf
Dynamic: QR → https://qr.example.com/abc → redirects to current menu
Benefits:
- Change destination without reprinting
- Track scan analytics
- A/B test destinations
Security Considerations
⚠️ QR codes can be malicious:
- Phishing URLs
- Malware downloads
- Automatic actions (call premium numbers, etc.)
For your apps:
- Validate scanned data before acting on it
- Show URL preview before opening
- Don't auto-execute commands from QR input
Quick Project Ideas
- QR-based 2FA backup — Encode TOTP secrets for recovery
- Event check-in system — Scan ticket QR, mark attended
- Asset tracking — QR labels on equipment linking to inventory DB
- Restaurant ordering — Table QR → menu → order
- WiFi onboarding — Guest scans, agrees to terms, gets access
Wrapping Up
QR codes are a solved problem—but an underutilized one. Next time you're typing a URL on mobile or sharing WiFi credentials verbally, consider: would a QR code be faster?
Need a quick QR code? qrcreator.site — free, instant, no account needed.
Top comments (0)