Text to QR Code Generator
Generate QR codes from any text or URL instantly. Customize size, colors, and error correction. Download as PNG. Free, fast, no signup required.
About
QR codes encode data into a two-dimensional matrix of dark and light modules readable by optical scanners. The encoding process involves selecting the optimal data mode (Numeric, Alphanumeric, or Byte), generating Reed-Solomon error correction codewords over the Galois field GF(28), and applying one of eight mask patterns to minimize decoding errors. A misconfigured error correction level or an oversized payload silently produces an unscannable image. This tool implements the full ISO/IEC 18004 pipeline client-side: mode analysis, polynomial division for ECC, format and version bit encoding via BCH codes, and penalty-based mask optimization. It handles payloads up to version 40 (177×177 modules), supporting up to 2953 bytes at error correction level L.
Pro tip: for printed materials, use error correction level Q or H. Physical damage from weather, folds, or partial obstruction can destroy up to 30% of codewords at level H and the code remains scannable. For digital-only use (screens, PDFs), level L maximizes data density. Note: this tool approximates visual output. Actual scannability depends on print resolution, contrast ratio, and scanner quality. Always test generated codes with at least two different reader applications before production use.
Formulas
QR codes use Reed-Solomon error correction over the Galois field GF(28) with the irreducible polynomial p(x) = x8 + x4 + x3 + x2 + 1 (value 0x11D). The data polynomial D(x) is divided by the generator polynomial G(x) to produce error correction codewords:
where R(x) is the remainder (EC codewords), n is the number of EC codewords, and the generator polynomial is:
Format information uses a 15-bit BCH(15,5) code with generator polynomial x10 + x8 + x5 + x4 + x2 + x + 1, XORed with mask 0x5412. Mask penalty is calculated across four rules: runs of same-color modules, 2×2 blocks, finder-like patterns, and dark/light ratio deviation. The mask producing the lowest total penalty score is selected.
where α is the primitive element of GF(28), D(x) = data polynomial, G(x) = generator polynomial, R(x) = remainder (error correction codewords), n = number of EC codewords per block.
Reference Data
| Version | Modules | EC Level L (bytes) | EC Level M (bytes) | EC Level Q (bytes) | EC Level H (bytes) |
|---|---|---|---|---|---|
| 1 | 21×21 | 17 | 14 | 11 | 7 |
| 2 | 25×25 | 32 | 26 | 20 | 14 |
| 3 | 29×29 | 53 | 42 | 32 | 24 |
| 4 | 33×33 | 78 | 62 | 46 | 34 |
| 5 | 37×37 | 106 | 84 | 60 | 44 |
| 6 | 41×41 | 134 | 106 | 74 | 58 |
| 7 | 45×45 | 154 | 122 | 86 | 64 |
| 10 | 57×57 | 271 | 213 | 151 | 119 |
| 15 | 77×77 | 520 | 412 | 295 | 223 |
| 20 | 97×97 | 858 | 666 | 482 | 364 |
| 25 | 117×117 | 1273 | 998 | 718 | 538 |
| 30 | 137×137 | 1732 | 1370 | 982 | 742 |
| 35 | 157×157 | 2188 | 1732 | 1246 | 946 |
| 40 | 177×177 | 2953 | 2331 | 1663 | 1273 |