How a QR code stores your data
A QR code is a grid of dark and light squares called modules, defined by the ISO/IEC 18004 standard. The three large squares in the corners are finder patterns that let a camera locate and straighten the code; smaller alignment patterns and timing lines help it read a code printed on a curved or tilted surface. The rest of the grid holds your data plus error correction codewords.
Codes come in 40 sizes called versions. Version 1 is 21×21 modules and each version adds 4 modules per side, up to 177×177 for version 40. This generator picks the smallest version that fits your content at the error correction level you choose, so a short URL makes a sparse code that scans quickly, while a long vCard makes a dense one. The largest code holds 2,953 bytes of binary data, but anything near that limit is hard to scan from a phone.
The data is encoded in the most compact mode available: numeric, alphanumeric (upper-case letters, digits and a few symbols) or byte mode for everything else, including UTF-8 text with accents and emoji. The encoder used here is lean-qr, a small open-source library that is loaded only on this page and runs in your browser.