Base64 to QR Code Converter
Convert Base64 encoded strings to scannable QR codes instantly. Adjust error correction, size, and download as PNG. No uploads, fully client-side.
About
Base64 encoding inflates binary data by roughly 33%, producing strings of ASCII characters from the set A - Z, a - z, 0 - 9, +, /, and padding =. Embedding such strings directly into QR codes requires byte-mode encoding, which consumes 8 bits per character. A Version 40 QR symbol at error correction level L holds a maximum of 2953 bytes. Exceeding this silently truncates data or produces unreadable symbols in naive tools. This generator validates the Base64 input, computes Reed-Solomon parity using Galois Field GF(28) arithmetic, evaluates all 8 mask patterns against the ISO/IEC 18004 penalty rules, and renders the optimal matrix to a downloadable PNG.
The decoded byte length is shown so you can verify payload integrity before scanning. Note: QR scanners on older devices may struggle with versions above 25. For large payloads, increase the error correction level to M or Q at the cost of reduced capacity. This tool approximates display only; actual scanner compatibility depends on camera optics and decoder firmware.
Formulas
QR codes use Reed-Solomon error correction over GF(28) with the irreducible polynomial p(x) = x8 + x4 + x3 + x2 + 1 (value 0x11D). The generator polynomial for t error correction codewords is:
where α = 2 is the primitive element. Each data codeword is 8 bits. For byte-mode encoding, the character count indicator length depends on the QR version:
The mask penalty score S is evaluated as S = N1 + N2 + N3 + N4, where N1 penalizes runs of 5+ same-color modules, N2 penalizes 2×2 blocks, N3 penalizes finder-like patterns, and N4 penalizes color imbalance. The mask with the lowest S is selected.
Where V = QR version (1 - 40), t = number of EC codewords per block, α = primitive element in GF(28), N1..4 = penalty rule scores per ISO/IEC 18004.
Reference Data
| QR 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 | 292 | 220 |
| 20 | 97×97 | 858 | 666 | 482 | 364 |
| 25 | 117×117 | 1276 | 998 | 718 | 538 |
| 30 | 137×137 | 1732 | 1370 | 982 | 742 |
| 35 | 157×157 | 2306 | 1812 | 1306 | 986 |
| 40 | 177×177 | 2953 | 2331 | 1663 | 1273 |