QR Codes have a limited capacity. The more data you encode, the larger and more complex the code becomes, making it harder to scan. Qrafter now includes a compression feature that transparently reduces the size of your QR Code content, resulting in smaller codes that are easier to scan and print. You can also use this feature in the free online QR Code Generator.
Why Compress?
Every QR Code has a version that determines its physical size. Version 1 is a tiny 21×21 module grid, while version 40 is a dense 177×177 grid. As content grows, the QR Code jumps to a higher version with more modules. Compression can keep the content small enough to fit in a lower version, producing a physically smaller and easier-to-scan code.
This is especially useful for content types that compress well, such as:
- vCards and meCards — Repetitive field names like
TEL:,EMAIL:, andADR:compress significantly - Calendar events — iCalendar format has many repeating keywords
- Long text — Natural language text compresses well due to character frequency patterns
- WiFi configurations — The
WIFI:S:...;T:...;P:...;;format has compressible structure
Compression is most effective with structured content like vCards. A typical contact card can produce a QR Code that is 10–20% smaller in physical dimensions.
How It Works
The compression process is fully transparent — when enabled, Qrafter automatically determines whether compression actually reduces the QR Code size and only applies it when beneficial. Here is what happens behind the scenes:
- The content is compressed using zlib (raw deflate, RFC 1951)
- The compressed data is Base45 encoded for optimal QR Code storage
- The result is wrapped with
~Z:and:to identify the content as compressed - Qrafter compares the resulting QR Code size against the uncompressed version
- If the compressed version produces a smaller QR Code, it is used; otherwise, the original content is kept
Compressed Format
The final format of a compressed QR Code looks like this:
~Z:BASE45_ENCODED_COMPRESSED_CONTENT:
Why Base45?
Compressed data is binary, which cannot be directly encoded in a QR Code efficiently. Base45 encoding (RFC 9285) converts binary data into a 45-character alphabet that maps directly to the QR Code alphanumeric character set. This allows the QR Code encoder to use its most efficient mode, resulting in smaller codes compared to alternatives like Base64.
Compression with Encryption
Compression and encryption can be used together. When both are enabled, Qrafter compresses the content first, then encrypts the compressed data. This order is important because encrypted data appears random and does not compress well, while compressing before encryption preserves the compression benefit.
The resulting QR Code is wrapped with the encryption format ~E:...:, and the compressed content inside is transparent to the decryption process. When scanned with Qrafter, the code is first decrypted, then decompressed automatically.
Using Compression
In Qrafter for iOS
To enable compression, go to Code Settings and turn on Compress Code Content. This is an app-wide setting that applies to all QR Codes you create. Qrafter handles everything automatically — it will only apply compression if it results in a smaller code.
In the Online Generator
The free online QR Code Generator also supports compression. Enable the "Compress Content" option, and the generator will show you the compression savings (as a percentage) when compression is applied.
Compatibility
Compressed QR Codes can only be read by Qrafter for iOS. Other QR Code scanners will see the raw ~Z:...: string. If you need your QR Codes to be universally scannable, leave compression disabled.
This is the same trade-off as with encryption — both features are designed for use within the Qrafter ecosystem, where the app automatically detects and processes these special formats.
Compression in Qrafter is a simple way to make your QR Codes more compact without any effort. Enable it, and Qrafter takes care of the rest — only compressing when it actually helps.