← Back to Home

QR Code Generator

/qr
Generate customizable QR codes in SVG format with comprehensive options for size, error correction, and margins. Perfect for creating scalable QR codes for URLs, WiFi credentials, contact info, and more.
Try it now

Parameters

text query
Text or URL to encode (required)
size query
Size in pixels (50-2000, default: 300)
ec query
Error correction: L (7%), M (15%), Q (25%), H (30%) - default: M
margin query
Quiet zone margin (0-10, default: 4)

Examples

curl
# Basic QR code
curl "https://tcpdata.com/qr?text=Hello+World" > qr.svg

# URL with custom size
curl "https://tcpdata.com/qr?text=https://tcpdata.com&size=500" > qr.svg

# High error correction
curl "https://tcpdata.com/qr?text=Important+Data&ec=H" > qr.svg

# WiFi QR code
curl "https://tcpdata.com/qr?text=WIFI:S:MyNetwork;T:WPA;P:password123;;" > wifi-qr.svg

# WireGuard config QR
curl "https://tcpdata.com/qr?text=%5BInterface%5D%0APrivateKey%3Dkey123%0AAddress%3D10.0.0.2%2F24%0A%5BPeer%5D%0APublicKey%3Dpeer123%0AEndpoint%3Dvpn.example.com%3A51820&ec=L" > wireguard.svg

# vCard contact QR
curl "https://tcpdata.com/qr?text=BEGIN:VCARD%0AVERSION:3.0%0AFN:John+Doe%0ATEL:+1234567890%0AEND:VCARD" > contact-qr.svg
JavaScript (fetch)
// Generate QR code
const params = new URLSearchParams({
  text: 'https://tcpdata.com',
  size: 400,
  ec: 'M'
});

const response = await fetch(`https://tcpdata.com/qr?${params}`);
const svg = await response.text();

// Display in img tag
const img = document.createElement('img');
img.src = 'data:image/svg+xml;base64,' + btoa(svg);
document.body.appendChild(img);

// WiFi QR code
const wifiQR = await fetch(`https://tcpdata.com/qr?text=${
  encodeURIComponent('WIFI:S:MyNetwork;T:WPA;P:password123;;')
}&size=300`);
Python (requests)
import requests

# Generate QR code (returns SVG)
response = requests.get('https://tcpdata.com/qr', params={
    'text': 'https://tcpdata.com',
    'size': 500,
    'ec': 'H'
})

# Save to file
with open('qrcode.svg', 'wb') as f:
    f.write(response.content)

# WiFi QR code
wifi_params = {
    'text': 'WIFI:S:MyNetwork;T:WPA;P:password123;;',
    'size': 400
}
wifi_qr = requests.get('https://tcpdata.com/qr', params=wifi_params)
with open('wifi-qr.svg', 'wb') as f:
    f.write(wifi_qr.content)

# Get SVG as text
svg_response = requests.get('https://tcpdata.com/qr', params={
    'text': 'Hello World',
    'ec': 'Q'
})
print(svg_response.text)  # SVG XML