QR code · Up to 2953 bytes at version 40-L
QR codes for binary and file data
When a QR code carries bytes rather than text, and why files rarely belong in one.
Key facts
| Byte capacity | Up to 2953 bytes at version 40-L |
|---|---|
| Text assumption | Many scanners decode bytes as UTF-8 |
| Binary overhead | Base64 adds about 33% |
| Better transport | A short URL to the file |
| Use cases | Keys, small configuration blobs, offline handoff |
Bytes are legal, text is expected
The standard allows arbitrary bytes in byte mode, but most consumer scanners assume text and may mangle non-UTF-8 data. If a payload must be binary, encode it in a text-safe form such as Base64 or hex and say so in the wrapper. That costs space but survives every scanner that returns a string.
Files do not fit
A 2 KB payload is already at the edge of version 40, and a photo is orders of magnitude larger. For anything beyond a small key or configuration blob, put the data behind a URL and encode the URL. The QR code is a pointer, not a storage medium.
Frequently asked questions
Can a QR code contain a file?
Only a very small one, and many scanners will not preserve it as bytes. Use a URL to the file instead.
Should I Base64-encode binary data?
It is the most compatible choice, at the cost of roughly a third more characters.
How much binary data fits?
At most 2953 bytes in a version 40 symbol at level L, less at higher correction levels.