All Tools View Categories Blog About Contact Privacy

QR Codes Explained: How They Work and How to Create One

QR Codes Explained: How They Work and How to Create One

QR is a 2D Quick Response code — three finder squares locate it at any angle, Reed-Solomon corrects 30% damage, and a phone decodes https://example.com or MATMSG:TO:hi@example.com in 200ms. This guide explains how QR codes work (ISO 18004), the 7 parts of the pattern, why version 1 is 21×21 and 40 is 177×177, and how to create one for URL, email, WiFi, or vCard — sharp, printable, with logo and correct error level.

TL;DR — QR Codes:
  • What: 2D barcode (ISO 18004) invented by Denso Wave 1994 — 4,296 alphanum chars vs 20 for 1D, 360° scan, no orientation needed. Static = data in pattern (https://example.com), Dynamic = short URL inside → redirect, editable, trackable.
  • Anatomy: Finder (3 corners, 1:1:3:1:1), Alignment (larger versions), Timing (row/col sync), Data modules (black/white bits), Error Correction Reed-Solomon L 7% / M 15% / Q 25% / H 30%, Version 1 21×21 → 40 177×177, Quiet Zone 4 modules white border (required).
  • How scan works (200ms): Find finders → unwarp via timing/alignment → sample modules → error-correct then de-mask → decode mode (numeric/alphanum/byte/kanji) → string https://... or WIFI:T:WPA;S:...;P:...
  • Create Email QR: use MATMSG MATMSG:TO:hi@example.com;SUB:Hi;BODY:Hello;; or mailto. One click via our QR code generator email (type email → auto MATMSG → pick H 30% if logo → download PNG/SVG). Same for WiFi WIFI:T:WPA;S:SSID;P:pass;;, vCard BEGIN:VCARD, URL.
  • Design: Center logo <30% → needs H; contrast dark on light (black #000 on white), not inverse; min 2 cm (≈0.8in) print, vector SVG for billboard, keep quiet zone white. Short URL → smaller version, more scannable.

What Is a QR Code — 2D, Fast, and Not a Barcode

Barcode (1D) is stripes along one axis — 20 chars, must orient horizontally. QR (Quick Response, Denso Wave for Toyota, 1994) is squares on two axes — 4,296 alphanum chars (2,953 bytes), scanned at any angle via finder patterns. Standard is ISO/IEC 18004 (also AIM). See Denso QR standards.

Static vs Dynamic matters for editing/tracking:

  • Static: data https://example.com/sale is directly in black/white modules. Can't edit without reprinting; no analytics (scanner just sees URL). But no service dependency, forever works. Good for WiFi, vCard on business card.
  • Dynamic: QR contains short URL https://short.ly/abc → server redirects to https://example.com/sale → you can edit target, get scan counts, UTM. Needs shortener service (may expire, pay). Good for campaign that may change.
What is QR 2D vs barcode static vs dynamic data types

Data types encoded as plain text the scanning app parses:

  • URL: https://example.com?utm_source=qr → browser.
  • WiFi: WIFI:T:WPA;S:MyNetwork;P:secret123;; → phone joins.
  • Email: mailto:hi@example.com?subject=Hi&body=Hello or MATMSG:TO:hi@example.com;SUB:Hi;BODY:Hello;; → mail compose (MATMSG is more compatible).
  • vCard: BEGIN:VCARD\nFN:Ada Lovelace\nTEL:+123\nEND:VCARD → contact.
  • SMS: smsto:+123:Hello → SMS.
  • Geo: geo:37.7749,-122.4194 → maps.
  • Text: any.

Email QR is not an image of an envelope — it's text MATMSG that the mail app understands. See ZXing Barcode Contents for format catalogue.

Static URL with UTM Before Print

If static, add UTM before generate: https://example.com/product?utm_source=qr&utm_medium=poster&utm_campaign=spring → analytics in GA. Dynamic can add later; static can't.

Anatomy — 7 Parts, Quiet Zone Is Part of Code (Sharp)

QR anatomy finder alignment timing data error correction quiet zone versions
  1. Finder Patterns — 3 corners: large nested squares with ratio 1:1:3:1:1 black-white-black-white-black (scan line) — locate and orient regardless rotation. Don't cover with logo.
  2. Separators: white border around finders.
  3. Timing Patterns: alternating black/white row and column between finders — sync sampling grid.
  4. Alignment Patterns: smaller squares inside (versions ≥2) — correct perspective warp (curved poster, angle). Version 1 has none; version 40 has many.
  5. Format and Version Info: small blocks near finders encoding error level and mask, and version number for ≥7.
  6. Data and Error Correction Modules: remaining black/white = bits: data codewords + Reed-Solomon parity. Mask pattern flips to avoid large solid blocks (improves decode).
  7. Quiet Zone: 4 modules white border around entire code — required per ISO, not decoration. No text, no logo touching — break → fail. Like barcode quiet zone.

Versions 1 to 40: Version 1 is 21×21 modules (~25 alphanum chars at M). Each version adds 4 modules per side: Version 40 is 177×177 (~4,296 alphanum or 2,953 bytes). Larger version = more data, denser modules — needs larger print or better camera. Shorten URL → smaller version → more scannable. See ISO 18004 versions.

Error Correction Reed-Solomon: L 7% (recover 7% damaged), M 15%, Q 25%, H 30% (recover 30% covered). Logo center covers ~20% → need H. Choose before generate — higher H → fewer data modules (smaller capacity) but robust. Our tools default M, offer H for logo. See Reed-Solomon.

How Scanning Works — Camera to URL in 200ms (Sharp Steps)

How QR scanning works find align read decode quiet zone
  1. Find: grayscale → binarize → scan for 1:1:3:1:1 dark-light-dark-light-dark run in any direction — three finders locate corners and orientation (fourth corner inferred).
  2. Align and Unwarp: timing patterns give grid step; alignment patterns correct perspective (photo at angle, curved can). Software computes homography and samples regular grid.
  3. Read: sample each module center → bit 0 white /1 black → apply mask (XOR) → codewords → Reed-Solomon correct errors → bytes. Mask avoids large white/blank blocks that confuse. See ZXing (widely used decoder) implementation.
  4. Decode: Mode indicator: 0010 alphanum, 0100 byte etc. → charset (UTF-8 vs Shift JIS) → string. For URL: https://example.com; for WiFi: WIFI:T:...;; → OS parses.

Quiet zone is step 1 prerequisite: without 4-module white, finder edge blends with text → not located. Leave margin.

Modes

Numeric (digits only) most compact → 3 digits per 10 bits; Alphanumeric (0-9 A-Z $%*+-./: and space, uppercase) → 2 chars per 11 bits; Byte (binary, UTF-8) → 8 bits per char; Kanji 13 bits. https://example.com uses Byte mode UTF-8; 123456 would use Numeric for smaller.

How to Create a QR Code — URL, Email, WiFi, vCard (One Click Sharp)

How to create QR email MATMSG WiFi steps sharp

Email (your requested link): Two textual forms both scan to compose — but MATMSG more compatible on Android:

  • mailto:hi@example.com?subject=Hello&body=Hi%20there — standard mailto with URL-encoded body.
  • MATMSG:TO:hi@example.com;SUB:Hello;BODY:Hi there;; — DoCoMo format, semicolons, double semicolon end — many email QR generators use this (iOS and Android both parse).

Steps via our QR code generator email: 1) Type hi@example.com, subject Hello, body → tool auto produces MATMSG:... behind the scenes (no manual semicolons). 2) Pick error level H (30%) if you will add logo, else M (15%) default. 3) Download PNG (600px+ for print) or SVG (vector for billboard) → test with phone before printing 2cm+ with quiet zone.

Other types — same workflow:

  • URL: https://example.com?utm_source=qr → browser; short URL → smaller version → more scannable → shorten before generate.
  • WiFi: WIFI:T:WPA;S:MyNetwork;P:secret123;H:false;; → phone joins (T=WPA/WEP/nopass, H:hidden). See ZXing WiFi.
  • vCard: BEGIN:VCARD\nVERSION:3.0\nFN:Ada Lovelace\nTEL:+123456\nEMAIL:ada@example.com\nEND:VCARD → contact. Keep short or QR becomes dense version 40.
  • SMS: smsto:+123:Hello → SMS.

Our generator builds these strings correctly — hand-typing WIFI:T:WPA;S:My;Net;P:pass;; with space breaks SSID — tool encodes.

Version Auto-Select

You don't pick version — tool chooses smallest that fits data + error level: short URL https://a.co → Version 1 21×21; long vCard 500 chars → Version 10+ ~57×57. Shortening URL reduces version, improves scan at small print.

Design and Print — Logo, Colors, Size (Sharp Fonts)

Design logo colors size vector SVG quiet zone sharp
  • Logo & Colors: Center logo <30% of area → use H 30% error so covering 20% still decodes. Dark modules on light background (#000 on #FFF) contrast 4.5:1 required; light on dark often fails (inverts). Test inverted only if decoder supports. Brand color dark blue on white OK; yellow on white fails (low contrast). See Denso design guide.
  • Size: Min ~2 cm (0.8in) square for phone at 10 cm distance — 1.5cm may fail on low-res cameras. Billboard: scale vector SVG, not PNG (PNG pixelates). Sharp fonts note: our PNGs export 1200px wide via sharp png compressionLevel 9, headings 13pt bold #0f172a on white 4.5:1, body 12pt #334155 — no 9pt thin — for retina crisp at 2×; SVG for print stays vector sharp at any size.
  • Quiet Zone: 4 modules white border — part of spec, not whitespace you can trim for design. No text touching. Leave margin.
  • Short URL → smaller version: https://example.com/very/long/path/with/params?x=1 → version 8 49×49 dense; short https://a.co/x → version 2 25×21 sparser, more scannable at 2cm. Shorten before generate.

Export choice: SVG for print (vector stays sharp at billboard) + PNG 600-1200px for web. Test scan from print proof with both iOS Camera and Android Lens before mass print.

Error Level Choice

No logo, clean print → M 15% (default, max data). Logo <20% or outdoor (dirt) → H 30% (robust, larger). Choose before generate — higher H → larger version for same data (more parity modules). Our email generator offers H toggle.

Pitfalls — Static vs Dynamic, Scan Failures, and Tracking

Pitfalls static frozen vs dynamic editable scan failures
PitfallFix
Static can't editData in pattern → reprint to change. Use dynamic short URL redirect for editable campaign.
No analyticsStatic has no counts — dynamic shortener logs scans, or add UTM to static URL before generate ?utm_source=qr → GA tracks.
Logo over finderCovering finder or timing breaks locate → keep logo center <30% and avoid finder corners.
Low contrast / tinyYellow on white, or <1.5cm square, or no quiet zone → scan fails on low light — use dark on light, 2cm+, 4 modules border.
Long data → dense V40500-char vCard → 177×177 dense → needs 4cm. Shorten URL or split.

Tracking: Dynamic https://short.ly/abc counts scans, device, location; static with UTM https://example.com?utm_source=qr counts via site analytics without service dependency — choose per need (privacy vs editability). See UTM.

Security — Don't Encode Secrets

QR is plain text — WIFI:P:secret on poster is visible to any scanner (photo). Don't encode private password on public poster; use guest network. mailto: with body is visible — no sensitive data.

History — Denso Wave 1994 to ISO 18004 (Why It Looks Like That)

Barcode (1D) needed orientation and held 20 chars. Denso Wave, Toyota supplier, needed to track thousands of car parts fast without aligning scanner — engineer Masahiro Hara added 3 finder squares with 1:1:3:1:1 ratio detectable at any angle, plus timing patterns for sync. Standardized as ISO/IEC 18004 (also QR specs). Versions added alignment patterns and larger matrices for more data — hence version 1 21×21 → 40 177×177.

Data Types Deep — Which Mode Packs Smallest

ModeCharsBits per UnitExample
Numeric0-910 bits per 3 digits123456 → most compact
Alphanumeric0-9 A-Z $%*+-./: + space (uppercase)11 bits per 2 charsHELLO WORLD
Byte (Binary)ISO-8859 or UTF-88 bits per charhttps://example.com (byte, lowercase)
KanjiShift JIS kanji13 bits per char日本

Compiler picks most compact mode per segment — https://example.com uses Byte (lowercase), 1234567890 uses Numeric (10 bits per 3 digits = 3.3 bits per digit vs 8 for Byte). That's why 123 QR is smaller than abc at same characters.

Why https:// Is Byte Not Alphanum

Alphanumeric includes uppercase, not lowercase — https lowercase forces Byte mode (UTF-8) — 8 bits per char vs 11 per 2 alphanum. If your URL is uppercase HTTPS://EXAMPLE.COM, alphanumeric would be smaller but urls are lower.

Version and Capacity — 21×21 to 177×177 (How Dense Is Too Dense)

Version = size: width = 21 + (version-1)×4 modules. Capacity at error M (15%):

VersionSizeNumericAlphanumByte
121×21412517
1057×57652395271
40177×177708942962953

Larger version = more data, denser modules → needs larger print or better camera focus. Shorten data → smaller version → sparser → more scannable at 2cm. Tool auto-picks smallest version that fits data + error level — don't force version 40 for https://a.co.

Capacity vs Version Check — Shorten Before Large:
https://example.com/very/long/path/with/params?x=1&y=2 → Version 8 49×49 dense
https://a.co/x → Version 2 25×25 sparse → scans faster at 2cm, needs less H
Shorten URL before generate — smaller QR is sharper, not just shorter link.

WiFi, vCard, and SMS — Text Formats Behind the Scan

Each type is just text the OS knows:

  • WiFi — WIFI:T:WPA;S:MyNetwork;P:secret123;H:false;; (T=WPA/WEP/nopass, S SSID, P password, H hidden). Spaces in SSID must be exact — My Network vs MyNetwork fails. See ZXing WiFi. Generate via tool to escape ; and \ in password.
  • vCard — BEGIN:VCARD\nVERSION:3.0\nFN:Ada Lovelace\nTEL:+123456\nEMAIL:ada@example.com\nEND:VCARD — keep under ~300 chars or QR becomes version 10 dense. Large photo PHOTO;BASE64:... bloats → version 40 → needs 4cm print. Minimal vCard is name+tel+email.
  • SMS — smsto:+123:Hello (colon before body on some parsers, SMSTO:123:Hi variant) and sms:+123?body=Hi. Test on both iOS and Android — one may prefer smsto.

Plain Text vs Structured

QR with Hello world shows text, not action — structured https:// vs WIFI: vs BEGIN:VCARD triggers app. Don't QR plain email hi@example.com — use mailto: or MATMSG to open compose, not just display address.

Color, Logo, and Background — Contrast Is King (Sharp)

Black on white is max contrast (21:1). Brand dark blue (#0f172a) on white passes (15:1). Yellow #FACC15 on white fails (1.5:1) — scanner sees white on white → not found. Test: screenshot QR, convert to grayscale, can you still see finder squares clearly? If not, contrast too low. Tool defaults dark #111827 on white — keep. Light modules must stay near white, not transparent over busy photo — photo background breaks quiet zone and confuses binarize. If you must overlay on photo, add white padded box behind QR.

Logo — How Much Is Safe

Logo covers data modules, not error bits — H 30% can restore 30% covered area, but only if logo is centered and not covering finders. Cover 20% center with H → still decodes; cover finder → fails even at H. Keep logo square, <30% width/height of QR, on white square background with padding.

Scanning Apps — Why iOS Camera and Android Lens Differ

iOS Camera app natively recognizes QR via Vision framework — no app needed, shows banner. Android Lens or Camera also, but older Android needs Google Lens app. Both decode via ZXing port or proprietary. Test both before mass print — WiFi WIFI: is handled by system on both since iOS 11, but some older Android ignore MATMSG and need mailto:. That's why email generator offers both.

Analytics Without Dynamic

If static but you need counts without dynamic shortener, embed UTM: https://example.com/landing?utm_source=poster&utm_medium=qr&utm_campaign=spring2025 → GA counts via site, not QR service. Dynamic plus UTM is double counting — pick one. UTM makes static trackable without dependency.

Security — Don't Put Secrets in a QR on a Poster

QR is plain text readable by any camera (photo from 5m with zoom). WIFI:T:WPA;S:Guest;P:secret123;; on lobby poster is visible to any scanner — photo captures secret. Don't encode private WiFi password on public poster; use guest VLAN or QR that expires (dynamic short URL with time-limited token). mailto: body with API key similarly leaks. QR is identifier, not encryption — treat content as public.

Phishing via QR (Quishing)

QR can encode https://examp1e.com (1 vs l) — attacker stickers poison. User sees QR, not URL until after scan shows preview → tap. Train to check preview URL before tapping, and use dynamic QR with domain you control so preview shows your domain. Never QR a direct download without preview.

Record Keeping — Version and Validate in Print

Keep source data (email string) + version/error choice + PNG/SVG files in git. Validate before mass print: scan proof with both iOS Camera and Android Lens at final size and distance, plus zbarimg proof.png via ZXing CLI. Check https://zxing.org/w/decode.jspx upload. If decoded string equals input exactly (including ;; terminators), print. Keep one source — QR image is output, not source; source is the MATMSG string.

Print Checklist — Sharp & Scannable:
1) Data short? https://a.co/x → Version 2 vs long path → Version 8 dense
2) Logo <30%? Use H 30% if yes, else M 15%
3) Contrast dark #111827 on white, not yellow on white
4) Size ≥2cm with 4-module quiet zone, SVG for billboard, PNG 600px+ for web
5) Test iOS + Android at distance before 1000 prints
Fail any → fix before print, not after.

Copy working MATMSG:TO:hi@example.com;SUB:Hi;BODY:Hello;; template — one correct reused beats four hand-typed with different missing ;; that fails to parse on some phones.

Keep one source — committed MATMSG string for docs, PNG/SVG for print — choose per context, not per file.

Validate early, fail fast before print — not after 1000 posters where MATMSG missing ;; fails on Android but passes iOS.

Keep one source — MATMSG string in git, PNG/SVG generated — so history shows who changed what when email body changed.

Version your QR source — v1 with MATMSG, v2 adds WIFI: — so git diff shows which was added.

Validate at print — zbarimg fails fast before mass.

Keep one source — MATMSG string for docs, PNG/SVG for print — choose per context.

Frequently Asked Questions

What is a QR code?

Quick Response 2D barcode (ISO 18004) — black/white modules encoding up to 4,296 alphanum chars, 360° scannable via 3 finder squares, with Reed-Solomon error correction L/M/Q/H — invented by Denso Wave 1994 for Toyota parts.

How do QR codes work?

Camera finds 3 finder patterns (1:1:3:1:1), unwarps via timing/alignment patterns, samples modules → bits → corrects via Reed-Solomon → de-masks → decodes mode (numeric/alphanum/byte) → string like https://example.com.

What is the difference between static and dynamic QR?

Static: data directly in pattern — can't edit without reprint, no analytics, forever works. Dynamic: short URL inside → redirect — editable target, scannable counts, needs shortener service.

How do I create a QR code for email?

Type recipient, subject, body into an email QR generator → it builds MATMSG:TO:hi@example.com;SUB:Hi;BODY:Hello;; or mailto: → choose H 30% if logo → download PNG/SVG → print 2cm+ with quiet zone. Our QR code generator email does this one click.

Can I put a logo in the middle of a QR code?

Yes if <30% center and error level H (30%) — covering 20% still decodes via Reed-Solomon. Don't cover finder patterns or timing, keep logo square, test scan before print.

What size should a QR code be printed?

Min ≈2 cm (0.8in) square for phone at 10cm; larger per distance (billboard meters). Use vector SVG for scale, keep 4-module quiet zone white, high contrast dark on light, short URL for smaller version.