📱 How to Use QR Codes: Complete Developer Guide

📅 August 26, 2026 📖 10 min read 🏷️ Tutorial

QR codes have evolved from a niche automotive tracking tool to an essential part of modern digital life. From restaurant menus to payment systems, WiFi sharing to event tickets — QR codes are everywhere. As a developer, understanding how to generate and work with QR codes is a valuable skill.

This guide covers everything you need to know: how QR codes work, the different types, and how to generate them in your applications.

🔲 What Is a QR Code?

QR stands for Quick Response. It's a two-dimensional barcode that stores information in a grid of black and white squares. Unlike traditional barcodes (which store data horizontally), QR codes store data in both directions — allowing them to hold much more information.

QR Code Capacity

📋 Types of QR Codes

QR codes can encode different types of data using specific formats. Here are the most common ones:

🌐 URL

Opens a website

https://example.com

📧 Email

Sends an email

mailto:user@mail.com

📞 Phone

Dials a number

tel:+1234567890

📶 WiFi

Connects to network

WIFI:T:WPA;S:Name;P:Pass;;

👤 vCard

Saves contact info

BEGIN:VCARD...

📍 Location

Opens map

geo:37.7,-122.4

⚡ Generate QR Codes Instantly

Create QR codes for URLs, WiFi, email, phone, and more — right in your browser.

Open QR Code Generator →

🔧 WiFi QR Code Format

One of the most useful QR code types for businesses and homes is the WiFi QR code. When scanned, it automatically connects the device to the network.

Format

WIFI:T:<authentication>:<SSID>P:<password>;

Parameters

Example

WIFI:T:WPA;S:MyHomeNetwork;P:SecretPassword123;;

👤 vCard QR Code Format

vCard QR codes encode contact information that can be saved directly to the phone's address book.

BEGIN:VCARD
VERSION:3.0
FN:John Doe
TEL:+1234567890
EMAIL:john@example.com
ORG:Acme Inc
TITLE:Software Engineer
URL:https://johndoe.com
END:VCARD

💻 Generating QR Codes Programmatically

JavaScript (using qrcode.js)

// Install: npm install qrcode
import QRCode from 'qrcode';

// Generate PNG data URL
const url = await QRCode.toDataURL('https://example.com');

// Generate to canvas
const canvas = document.getElementById('canvas');
await QRCode.toCanvas(canvas, 'https://example.com');

Python (using qrcode library)

# Install: pip install qrcode[pil]
import qrcode

qr = qrcode.QRCode(version=1, box_size=10, border=5)
qr.add_data('https://example.com')
qr.make(fit=True)

img = qr.make_image(fill_color="black", back_color="white")
img.save('qrcode.png')

Go

// go get github.com/skip2/go-qrcode
import "github.com/skip2/go-qrcode"

qr, _ := qrcode.New("https://example.com", qrcode.Medium)
png, _ := qr.PNG(256)
// Write png bytes to file

🎨 QR Code Design Tips

Pro Tip: Always test your QR codes with multiple devices and lighting conditions before printing them!

📱 Real-World Use Cases

Use CaseQR TypeExample
Restaurant menusURLLink to online menu
WiFi sharingWiFiGuest network access
Business cardsvCardContact information
PaymentsURL/AppPayment app deep link
Event ticketsText/URLTicket verification
Product trackingTextSerial numbers

✅ Best Practices

  1. Keep it simple: Shorter content = larger modules = easier scanning
  2. Test thoroughly: Scan with multiple devices and apps
  3. Provide context: Tell users what the QR code does
  4. Use URL shorteners: For URLs, shorter = better QR code
  5. Consider error correction: Use H level for printed materials
  6. Include a fallback: Show the URL/text below the QR code

🔗 Conclusion

QR codes are a simple yet powerful tool for bridging the physical and digital worlds. Whether you're building a contactless menu system, sharing WiFi credentials, or creating a marketing campaign, QR codes provide an elegant solution.

With modern libraries and tools, generating QR codes is easier than ever. Start experimenting with different types and use cases — and remember to always test before deploying!