←Back to Guides
๐Ÿ“ฑAuto-ID & Encoding Standardsโฑ๏ธ 13 min read•Updated November 2026•โœ๏ธBy Chris

2D QR Matrices, EAN-13 / Code 128 Barcodes & vCard / Wi-Fi Payload Encoding Runbook

Engineer reliable physical-to-digital scanning workflows: understand ISO/IEC 18004 QR error correction and quiet zones, EAN-13 modulo-10 check digits, Code 128B SKU encoding, and Wi-Fi / vCard 3.0 payload escaping rules.

#QR Code#EAN-13#Code 128#vCard#Wi-Fi QR#SVG#Reed-Solomon

1. QR Code Error Correction (Reed-Solomon) & The 4-Module Quiet Zone

Every QR matrix embeds Reed-Solomon forward error correction codewords alongside raw UTF-8 data. Higher ECC levels allow damaged labels, curved packaging, or center brand marks to remain scannable, at the trade-off of higher module density. Regardless of ECC level, optical scanners fail immediately if dark background chrome touches the matrixโ€”always reserve a clean 4-module white border (Quiet Zone) around all four sides.
ECC LevelRecovery CapacityBest Practice WorkloadDensity OverheadCopy
L (Low)Restores up to 7% damaged codewordsDense vCards on crisp OLED screensMinimal
M (Medium)Restores up to 15% damaged codewordsDefault URLs, tickets, and print receiptsBalanced
Q (Quartile)Restores up to 25% damaged codewordsShipping boxes and industrial asset tagsModerate
H (High)Restores up to 30% damaged codewordsOutdoor stickers or posters with center badgesMaximum

2. 1D Retail Barcodes: EAN-13 Checksum Math vs Code 128B SKUs

Retail GS1 scanners require 13-digit EAN-13 (or 12-digit UPC-A) symbologies with strict parity-encoded left halves and a trailing modulo-10 check digit calculated from the first 12 digits. By contrast, warehouse SKUs, shipping manifests, and alphanumeric serial numbers belong in Code 128B, which encodes full printable ASCII natively with a mandatory Start B symbol (104), weighted checksum modulo 103, and Stop pattern.
EAN-13 Modulo-10 Check Digit Algorithm (TypeScript)
export function ean13CheckDigit(first12: string): number {
  const sum = [...first12].reduce((acc, ch, i) => acc + Number(ch) * (i % 2 === 0 ? 1 : 3), 0);
  return (10 - (sum % 10)) % 10;
}

Alternates weights of 1 (even index) and 3 (odd index) before taking the complement modulo 10.

SymbologyCharacter SetChecksum StandardPrimary Industry RoleCopy
EAN-1312 numeric digits + 1 computed checkModulo 10 (1/3 weights)Global POS retail GTIN
UPC-A11 numeric digits + 1 computed checkEAN-13 leading 0 subsetNorth American retail
Code 128BFull ASCII 32-127 alphanumericModulo 103 weighted sumLogistics, warehouse SKUs, healthcare

3. Wi-Fi URI Syntax & vCard 3.0 Delimiter Escaping

Native iOS and Android camera apps parse structured QR prefixes directly in OS firmware. Wi-Fi onboarding URIs follow WIFI:T:WPA;S:NetworkName;P:SecretPass;H:false;;. Always backslash-escape literal semicolons (\;), colons (\:), commas (\,), and backslashes inside SSIDs or passwords; an unescaped semicolon truncates the passphrase silently during Android Wi-Fi Provisioner parsing.
Valid Wi-Fi QR & Minimal vCard 3.0 Payloads
WIFI:T:WPA;S:Office\;Guest;P:Correct\:Horse123;;

BEGIN:VCARD
VERSION:3.0
N:Doe;Jane;;;
FN:Jane Doe
TEL;TYPE=CELL:+31612345678
EMAIL:jane@example.com
END:VCARD

Use CRLF line endings for vCard 3.0 imports across macOS Contacts, iOS, and Outlook.

URI / Record PrefixOS Handler ActionCritical Validation PitfallCopy
WIFI:T:WPA;S:...;Prompts instant Join Wi-Fi Network dialogUnescaped ; : , or \ in SSID/PSK
BEGIN:VCARD / 3.0Opens Add Contact sheet offlineMissing N: property or non-CRLF newlines
https://...Displays verified domain preview bannerLow contrast inverted foreground colors

4. Vector SVG vs PNG Rasterization for Label Printers

Thermal label printers (203 DPI or 300 DPI) suffer barcode edge blurring when upscaling fuzzy JPEG or low-DPI PNG bitmapsโ€”often breaking narrow 1-module bars below scanner tolerance. Generating pure integer-aligned SVG paths ensures crisp black/white step edges at every physical label magnification.
๐Ÿ‘จโ€๐Ÿ’ป
Authored & Reviewed by ChrisMayPixels • Netherlands

Independent software developer focused on client-side architectures, local-first computing, WebAssembly, and privacy-first web systems.

About MayOnlineTools→

๐ŸŽ“Explore More Guides

โœจ