DEV Community

Cover image for QR Code Format Reference - Wi-Fi, vCard, URL, Email, Phone
TechMind
TechMind

Posted on • Originally published at techmind.click

QR Code Format Reference - Wi-Fi, vCard, URL, Email, Phone

The URI schemes that QR code generators use are standardised. Here is a reference for the five most common types with implementation notes.

Wi-Fi QR Code Format

// Standard WiFi URI — recognised natively by iPhone iOS 11+ and Android 10+
const wifiQR = (ssid, password, security = 'WPA') =>
  `WIFI:T:${security};S:${ssid};P:${password};;`;

wifiQR('MyNetwork', 'password123');
// → WIFI:T:WPA;S:MyNetwork;P:password123;;

// Security types: WPA, WEP, nopass (open networks)
// Escape special chars in SSID/password: \ " ; , :
Enter fullscreen mode Exit fullscreen mode

vCard QR Code Format (v3.0)

const vCardQR = ({ name, phone, email, company, url }) => `BEGIN:VCARD
VERSION:3.0
FN:${name}
TEL;TYPE=CELL:${phone}
EMAIL:${email}
ORG:${company}
URL:${url}
END:VCARD`;

// Scanned by any phone camera → prompts "Add Contact"
// Works with Apple Contacts, Google Contacts, Outlook
Enter fullscreen mode Exit fullscreen mode

URL - Most Common Type

// Just the URL — nothing special
// Short URLs scan faster (less data = simpler QR pattern)
// Always use https:// for trust signals
const urlQR = 'https://www.techmind.click/qr-code-generator';
Enter fullscreen mode Exit fullscreen mode

Email QR Code

const emailQR = (to, subject = '', body = '') =>
  `mailto:${to}${subject || body ? '?' : ''}${
    subject ? `subject=${encodeURIComponent(subject)}&` : ''
  }${body ? `body=${encodeURIComponent(body)}` : ''}`.replace(/&$/, '');

emailQR('hello@example.com', 'Inquiry', 'Hello, I would like to...');
// → mailto:hello@example.com?subject=Inquiry&body=Hello%2C%20I%20would%20like%20to...
Enter fullscreen mode Exit fullscreen mode

Phone QR Code

const phoneQR = (number) => `tel:${number}`;
// Include country code for international use
phoneQR('+919876543210'); // → tel:+919876543210
Enter fullscreen mode Exit fullscreen mode

Top comments (0)