DEV Community

Michael Lip
Michael Lip

Posted on • Originally published at zovo.one

QR Codes Encode More Than URLs: A Developer's Guide to QR Data Types

Most people think QR codes are just fancy links. Point your camera, open a webpage. But the QR specification supports multiple data types, and the interesting applications go well beyond URLs.

What a QR code actually stores

A QR code stores a string of characters. That's it. The magic is in how the scanning application interprets that string. Different prefixes trigger different behaviors:

URL: https://example.com - opens the browser
Wi-Fi: WIFI:T:WPA;S:NetworkName;P:password123;; - connects to a network
Phone: tel:+15551234567 - initiates a call
SMS: smsto:+15551234567:Your message here - opens a text message
Email: mailto:user@example.com?subject=Hello&body=Content - opens email
vCard: Multi-line contact card format - adds a contact
Calendar event: BEGIN:VEVENT...END:VEVENT - adds a calendar entry
Geo location: geo:40.7128,-74.0060 - opens maps

The scanning app recognizes these URI schemes and routes to the appropriate handler. This is why scanning a QR code can open your Wi-Fi settings, create a contact, or launch your email client without any custom app.

Capacity and version selection

QR codes come in 40 versions (sizes). Version 1 is 21x21 modules. Each subsequent version adds 4 modules per side. Version 40 is 177x177 modules.

Maximum capacities at error correction level L:

  • Numeric only: 7,089 characters
  • Alphanumeric: 4,296 characters
  • Binary (UTF-8): 2,953 bytes
  • Kanji: 1,817 characters

For a typical URL (50-100 characters), a Version 3 or 4 QR code suffices. For a vCard with full contact details, you might need Version 8-10. For large payloads (entire paragraphs of text), the QR code becomes physically large and harder to scan reliably.

The encoding modes

QR codes automatically optimize encoding based on content:

Numeric mode: digits 0-9 only. Three digits per 10 bits. Most efficient.
Alphanumeric mode: digits, uppercase A-Z, space, and symbols $%+-./: Two characters per 11 bits.
**Byte mode
: any UTF-8 character. One byte per 8 bits.
**Kanji mode
*: Japanese characters. One character per 13 bits.

A QR code can mix modes within a single payload. The encoder switches modes as needed to minimize total size. This is why a URL with mostly lowercase letters (byte mode) produces a larger QR code than the same URL in uppercase (alphanumeric mode).

Static vs dynamic QR codes

A static QR code contains the data directly. Once printed, it can't be changed. A dynamic QR code contains a short redirect URL (like qr.example.com/abc123) that points to the actual destination. The redirect can be updated without reprinting the QR code.

Dynamic QR codes also enable tracking: scan counts, location, time, device type. This is valuable for marketing but adds a dependency on the redirect service. If that service goes down or the company shuts down, every QR code using it becomes dead.

I built a QR code maker at zovo.one/free-tools/qr-code-maker that generates codes for all the data types above: URLs, Wi-Fi credentials, contacts, email, phone, SMS, and plain text. Download as PNG or SVG at any size.

I'm Michael Lip. I build free developer tools at zovo.one. 500+ tools, all private, all free.

Top comments (0)