qrcode
QR code generator for Node.js and browsers. Generates QR codes as PNG images (via Canvas), SVG strings, terminal ASCII art, or data URLs. Supports all QR code error correction levels (L/M/Q/H), custom color schemes, and character encoding options. Async and sync APIs. Used for generating authentication QR codes (TOTP/2FA), payment QR codes, product links, WiFi credentials, and contact vCards.
Score Breakdown
⚙ Agent Friendliness
🔒 Security
QR code generation library — no network surface. QR codes encoding secrets (TOTP keys) should only be shown once and never logged or stored as images.
⚡ Reliability
Best When
You need to generate standard QR codes as images, SVG, or data URLs in Node.js or browser applications.
Avoid When
You need to scan/decode QR codes (use jsQR), need other barcode formats (use JsBarcode), or need highly customized QR code designs.
Use Cases
- • Generate QR codes for TOTP two-factor authentication setup (authenticator app enrollment)
- • Create QR codes for payment links, product URLs, or marketing materials as PNG or SVG
- • Generate WiFi credential QR codes that users can scan to auto-connect to a network
- • Embed QR codes in server-generated PDFs, invoices, or tickets using the data URL or buffer output
- • Display QR codes in browser applications for sharing URLs, contact info, or app deep links
Not For
- • QR code scanning/reading — qrcode generates only; use jsQR or ZXing for QR code decoding
- • Barcodes other than QR (EAN, Code 128, etc.) — use JsBarcode for other barcode formats
- • Custom QR code designs (logo overlays, colors) — basic color support exists but use dedicated QR design libraries for styled QR codes
Interface
Authentication
No authentication — image generation library.
Pricing
Fully free, MIT licensed.
Agent Metadata
Known Gotchas
- ⚠ QR code capacity is limited by error correction level and version — higher error correction (H) = less data capacity; lower the correction level if input is too long
- ⚠ PNG output in Node.js requires canvas package which has native dependencies — if canvas install fails, use SVG output instead (no native deps)
- ⚠ toDataURL() is async but toFile() is also async — must await both; mixing sync and async QR API calls is a common source of bugs
- ⚠ URL encoding: special characters in URLs (spaces, Unicode) should be URL-encoded before creating QR codes for maximum scanner compatibility
- ⚠ QR code size: default module size may be too small to scan; use scale option to increase size: QRCode.toDataURL(text, { scale: 10 })
- ⚠ Version and mode auto-selection: library auto-selects optimal QR version and encoding mode; override with version and mode options only if specific QR parameters are required
Alternatives
Full Evaluation Report
Detailed scoring breakdown, competitive positioning, security analysis, and improvement recommendations for qrcode.
Scores are editorial opinions as of 2026-03-06.