Qraft

How Much Data Can a QR Code Hold? Understanding the Limits

Maximum QR Code Capacity

The upper limit of what a QR code can hold is reached at the largest size, version 40 (177×177 modules): 7,089 numeric digits, 4,296 alphanumeric characters, 2,953 bytes of binary data, or 1,817 kanji characters (Shift JIS). Measured in digits alone, that is more than 500 times the 13 digits a standard EAN-13 barcode carries.

All of those figures assume the lowest error correction level, L. At level M, the usual choice in practice, capacity falls to roughly 80 percent of L (5,596 digits, 2,331 bytes), and at the highly resilient level H to roughly 40 percent (3,057 digits, 1,273 bytes). When you estimate capacity, work from the numbers for the error correction level you will actually use rather than from the headline maximum.

Data Size Guidelines by Use Case

Here is a practical guide to how much data typical uses need, all assuming error correction level M. The figure in parentheses is the smallest version that fits the data, with its module count.

  • A short URL (for example https://example.com): 19 bytes. Lowercase letters force byte mode, and it fits in version 2 (25×25 modules)
  • A URL with parameters: around 100 bytes corresponds to version 6 (41×41 modules), and even 200 bytes once tracking parameters are appended still fits version 10 (57×57 modules)
  • Wi-Fi credentials: 50-80 bytes including the SSID and password, so anything up to version 5 (37×37 modules) will do
  • A vCard (contact card): 200-500 bytes once name, phone number, email and address are included, landing between version 10 and version 17 (57×57 to 85×85 modules)
  • Long text: Japanese stored in byte mode as UTF-8 costs three bytes per character, so even a few hundred characters push the version up sharply and make the pattern finer

How the Code Changes as Data Grows

QR codes are standardised in versions 1 through 40. Version 1 is 21 modules (the black and white cells) on a side and version 40 is 177, with each step up adding four modules to each side. As the stored data grows, the smallest version that can hold it is chosen automatically.

The drawback of a higher version is that if the printed size stays the same, each module gets smaller. Printed at 2 cm square, one module of a version 2 code is 0.8 mm, while a version 10 code drops to about 0.35 mm (a simple calculation that ignores the quiet zone around the code). The smaller the module, the more camera resolution and ink spread matter, and the more read errors occur.

That is why storing only the URL of a web page and letting people read the details at the link is more reliable than packing long text directly into the code. How to choose the right version for each use, meaning the version differences worth knowing, is covered separately in another article.

The trade-off with error-correction level

QR codes have an error-correction mechanism that lets them be read even with dirt or missing parts, and its strength can be chosen from four levels. The higher the correction level, the more extra data for restoration, so the actual amount of information that fits in a code of the same size decreases. In places that get dirty, such as outdoor signs, a high level is reassuring, but it consumes capacity accordingly. Conversely, a low level is enough if you only put a short URL indoors. Depending on the use, you choose whether to prioritize robustness or capacity.

Capacity differences by character type

The number of characters a QR code can store changes with the type of data you put in. Data of only numbers fits most efficiently, and the number of characters that fit in the same size decreases in the order of alphanumeric, kanji, and data including other symbols. This is because the amount of data needed to represent one character differs by type. That a long URL containing many symbols uses surprisingly much capacity is due to this mechanism. When you want to save capacity, reducing unnecessary symbols and keeping the character composition as simple as possible is effective.

Check by actually trying it

The quickest way to develop a feel for capacity is to generate codes while changing the content little by little and compare them side by side. These three experiments make it visible what actually pushes the version up (all at error correction level M).

  • Change only the error correction level: encode the same URL at level L and at level H, and although the content is identical the H code comes out at a higher version with a finer pattern
  • A short URL versus one with tracking parameters: the 19-byte URL fits in version 2 (25×25 modules), while adding utm_source and the like to reach 120 bytes requires version 7 (45×45 modules)
  • Digits only versus a string containing symbols: at the same 100 characters, digits alone fit in version 3 (29×29 modules), whereas mixing in symbols switches the code to byte mode and calls for version 6 (41×41 modules)

You can read the version off a finished code by counting the modules along one side: subtract 21, divide by 4, then add 1 (57 modules means version 10). Finally, print it at the size you will really use and check that it scans from the distance you expect, which is what prevents the discovery after printing that the code cannot be read.

Tips to Reduce Data Size

Tips for keeping QR codes compact:

  • Use URL shorteners: Shorten long URLs with bit.ly etc. for smaller QR codes
  • Remove unnecessary parameters: Minimize tracking parameters (utm_source, etc.) at URL ends
  • Leverage alphanumeric mode: ordinary URLs with lowercase letters are encoded in byte mode (8 bits per character). Alphanumeric mode covers only digits, uppercase A-Z, space and nine symbols, but costs just 5.5 bits per character
  • Put info on the web: Store only the URL in the QR code; put details on the linked page