QR Code Generator for URLs
Generate high-quality QR codes for any URL. Customize colors, size, and error correction level. Download as PNG. Free, instant, no signup required.
About
QR codes encode data into a two-dimensional matrix of dark and light modules, readable by any camera-equipped device. A typical URL like https://example.com/path?q=value requires between Version 2 (25Ć25 modules) and Version 10+ depending on length and the chosen error correction level. The encoding pipeline is non-trivial: raw bytes pass through polynomial division over GF(28) to generate Reed-Solomon error correction codewords. An incorrect implementation silently produces unscannable output. This tool implements the full ISO/IEC 18004 specification in-browser, including all four error correction levels (L at 7%, M at 15%, Q at 25%, H at 30% recovery), eight data masking patterns with penalty scoring, and proper interleaving for multi-block versions.
Limitation: this generator handles URLs up to approximately 2953 bytes (Version 40, Level L). For printed materials where partial obstruction is likely (stickers, merchandise), use Level Q or H. For clean digital displays, Level L maximizes data density. Pro tip: keep URLs short. Every additional character increases version size and reduces scan reliability at small print sizes.
Formulas
The QR code encoding process transforms a URL byte sequence into a structured binary matrix. The data capacity for a given version v and error correction level ec is determined by the total codewords minus error correction codewords.
Reed-Solomon error correction generates t error correction codewords from the data polynomial D(x) by computing the remainder when divided by the generator polynomial G(x). All arithmetic is performed in the Galois Field GF(28) with the irreducible polynomial p(x) = x8 + x4 + x3 + x2 + 1 (value 0x11D).
The generator polynomial for t error correction codewords is:
After placement, a masking pattern k is selected to minimize the penalty score P. The mask with the lowest total penalty across four evaluation rules is applied:
Where P1 penalizes runs of 5+ same-color modules (N1 = 3 + i), P2 penalizes 2Ć2 blocks (N2 = 3), P3 penalizes finder-like patterns (N3 = 40), and P4 penalizes dark/light ratio deviation from 50% (N4 = 10).
Reference Data
| Version | Modules | L (Max Bytes) | M (Max Bytes) | Q (Max Bytes) | H (Max Bytes) | EC Blocks (L) | EC Blocks (H) | Alignment Count | Typical Use |
|---|---|---|---|---|---|---|---|---|---|
| 1 | 21Ć21 | 17 | 14 | 11 | 7 | 1 | 1 | 0 | Short IDs |
| 2 | 25Ć25 | 32 | 26 | 20 | 14 | 1 | 1 | 1 | Short URLs |
| 3 | 29Ć29 | 53 | 42 | 32 | 24 | 1 | 2 | 1 | Standard URLs |
| 4 | 33Ć33 | 78 | 62 | 46 | 34 | 1 | 4 | 1 | URLs with params |
| 5 | 37Ć37 | 106 | 84 | 60 | 44 | 1 | 4 | 1 | Medium text |
| 6 | 41Ć41 | 134 | 106 | 74 | 58 | 2 | 4 | 1 | Long URLs |
| 7 | 45Ć45 | 154 | 122 | 86 | 64 | 2 | 5 | 6 | Complex URLs |
| 10 | 57Ć57 | 271 | 213 | 151 | 115 | 2 | 8 | 6 | Long text blocks |
| 15 | 77Ć77 | 520 | 412 | 292 | 220 | 4 | 12 | 10 | vCards |
| 20 | 97Ć97 | 858 | 666 | 482 | 364 | 5 | 16 | 15 | Large data |
| 25 | 117Ć117 | 1276 | 998 | 718 | 538 | 8 | 22 | 21 | Documents |
| 30 | 137Ć137 | 1732 | 1370 | 982 | 742 | 10 | 28 | 28 | Bulk data |
| 35 | 157Ć157 | 2306 | 1812 | 1306 | 986 | 12 | 34 | 36 | Max practical |
| 40 | 177Ć177 | 2953 | 2331 | 1663 | 1273 | 20 | 40 | 46 | Maximum capacity |