Generate a QR Code for a URL
Learn how to generate a QR code that opens a website URL when scanned. Covers HTTPS links, URL length limits, and best practices for web address QR codes.
Detailed Explanation
QR Codes for URLs
The most common use case for QR codes is encoding a website URL. When a user scans the QR code with their phone camera, the browser opens the encoded web address automatically.
How URL QR Codes Work
A URL QR code simply stores a text string that starts with http:// or https://. The scanning device recognizes the URL scheme and launches the default browser.
https://example.com/landing-page?ref=qr
There is no special encoding beyond standard QR code data encoding. The URL is stored as plain text within the QR code matrix.
URL Length and QR Code Size
QR codes have a maximum data capacity that depends on the error correction level:
| Error Correction | Max Alphanumeric Characters |
|---|---|
| Low (L) | 4,296 |
| Medium (M) | 3,391 |
| Quartile (Q) | 2,420 |
| High (H) | 1,852 |
Shorter URLs produce simpler QR codes that are easier to scan. If your URL is long, consider using a URL shortener or removing unnecessary query parameters.
Best Practices
- Always use HTTPS — Modern browsers warn users about insecure HTTP links, and many QR scanners flag non-HTTPS URLs as potentially unsafe.
- Test before printing — Generate the QR code, scan it with at least two different devices, and verify the page loads correctly.
- Include a fallback — When placing QR codes on physical media, print the short URL below the code for users who cannot scan.
- Use UTM parameters — Append
?utm_source=qr&utm_medium=printto track scans in your analytics platform. - Avoid redirects when possible — Each redirect adds latency. Point the QR code directly to the final destination URL when you can.
Error Correction for Physical Media
If the QR code will be printed on materials that may get damaged (stickers, outdoor signage), use a higher error correction level (Q or H). This allows up to 25-30% of the code to be damaged while still remaining scannable.
Use Case
URL QR codes are used on business cards, product packaging, restaurant menus, event posters, magazine advertisements, and retail displays. They bridge the gap between physical media and digital content, allowing users to instantly visit a webpage without typing a URL.