Why QR-2-Brick Limits URLs to a Maximum of 32 Characters
QR Codes (Quick Response Codes) have a very, very specific way of storing data.
Data is stored in the configuration of black and white dots, referred to as modules, arranged in a grid, called the symbol. The more data there is to store, the more modules are required in the configuration, resulting in a larger symbol.
QR Code Symbol Versions
There are different versions of the QR Code symbol (versions 1 to 40) which have an increasing maximum capacity for data. The smallest (Version 1) is just 21×21 modules, with each subsequent version incrementing by four modules, up to the largest (Version 40) with 177×177 modules.
Furthermore, to enable QR Code readers to easily pick-out the symbol from its surroundings, it is necessary to add a quiet zone (a white border) around it, which adds to the overall dimensions.
Usually we would use the most appropriate version for the data we wish to convert to a QR Code symbol, but because we need to fit our symbol into a fixed area (a 32×32 baseplate), we need to choose the version first and make our data fit it.
To fit a QR Code plus border on to a 32×32 baseplate, assuming each module is equal to one stud (the minimum physical size it can be), it is necessary to use a version that does not exceed that number of modules. At 29×29 modules, Version 3 only leaves a one stud border (two studs around two of the sides), which may not be a wide enough margin of error in a bustling environment. The next largest is Version 2 at 25×25 modules, which leaves a three stud border (four studs around two of the sides), which is plenty of room.
Now that we know the symbol version, there are yet still other factors that affect the amount of data that can be stored (and thus, the character length of the URL) — the type of data the string contains and the level of error correction used (added redundant data).
Types of Data
There are four type of data, each one requiring different numbers of bytes to encode a single character, therefore reducing the actual number of characters that can be encoded given the QR Code symbol level being used. In order of the number of bytes required per character and number of character types contained within the data, these are:
- Exactly as it suggests — the decimal digits 0-9.
- The letters A-Z (uppercase only!), digits 0-9, plus the symbols $%*+-./: (and the "space" character).
- 8-Bit (Byte)
- All 191 characters in the "Latin alphabet no. 1" character set (ISO-8859-1).
- Kanji/Kana (Double-Byte)
- Ideograms used in written Japanese (Shift JIS / JIS X 0208).
We are treating URLs as 8-bit (byte) data and not alphanumeric because they contain more character types than alphanumeric allows. For example, many URLs include underscores (_), and on some web servers character case (upper/lower) matters, so an all uppercase URL may not work.
Error correction is basically extra back-up data ("codewords") that helps QR Code scanners read the code when it might be damaged. There are four error correction levels with increasing error correction capability (ECC): the higher the ECC, the fewer characters can be encoded.
A brick-built QR Code mosaic is probably not going to get damaged or dirty, so we are using the lowest level of error correction ("L", 7% correction) which allows the most characters to be encoded for the size of module and type of data.
A Version 2 QR Code symbol (25×25 modules) encoded with 8-bit (byte) data at an ECC-L has a maximum capacity for 32 characters in the input data (the URL).
- Wikipedia Article - for an overview.
- QRCode.com - DENSO WAVE (inventor of the QR Code).
- QR Code Tutorial - in-depth information for programmers.
« Back to QR-2-Brick App