QR code glossary · Encoding and capacity
Encoding modes
Also called: Encoding mode, Data mode
Definition
Encoding modes are the ways a QR code packs characters into bits: numeric mode for digits, alphanumeric mode for a 45-character set of capital letters, digits and a few symbols, byte mode for any data such as UTF-8 text, and kanji mode for Japanese Shift JIS characters.
How it works
Each mode trades flexibility for density. The more limited the character set, the fewer bits each character needs:
| Mode | Characters | Bits |
|---|---|---|
| Numeric | 0–9 | 10 per 3 digits (about 3.3 per digit) |
| Alphanumeric | 0–9, A–Z (capitals only), space and $ % * + - . / : | 11 per 2 characters (5.5 per character) |
| Byte | Any 8-bit data | 8 per byte |
| Kanji | Shift JIS double-byte characters | 13 per character |
The content is written as one or more segments. Each starts with a 4-bit mode indicator and a character count whose length depends on the version range, so an encoder can switch modes mid-code, for example writing a long run of digits in numeric mode inside an otherwise byte-mode string. Other indicators cover ECI (declaring a character set), structured append (splitting data across up to 16 codes) and FNC1 (GS1 data).
The standard’s default interpretation of byte mode is ISO/IEC 8859-1 (Latin-1). In practice most encoders write UTF-8 and most phone readers detect it, so accented and non-Latin text usually displays correctly, but test any code that relies on it.
Why it matters
Generators choose modes automatically, but the content decides what is possible. Lowercase letters and characters such as ?, =, & and _ fall outside the alphanumeric set, so almost every web address is encoded in byte mode.
A web address written in capitals can use the denser alphanumeric mode, because the scheme and domain name are case-insensitive. The path usually is not: /R/A7K2Q9 and /r/A7K2Q9 can be different pages, so capitalize a link only if the server treats both the same. Long numbers, such as product numbers, are encoded most compactly in numeric mode.
Example
At level M, https://example.com/r/A7K2Q9 needs version 3 (29 × 29) in byte mode. Written as HTTPS://EXAMPLE.COM/R/A7K2Q9, it is encoded entirely in alphanumeric mode and fits version 2 (25 × 25).
Related terms
- Data capacityData capacity is the most content a QR code can hold, which depends on its version, error correction level and encoding mode; the largest code, version 40 at level L, holds 7,089 numeric digits, 4,296 alphanumeric characters, 2,953 bytes or 1,817 kanji characters.
- QR code versionA QR code’s version is its size on a scale from 1 to 40: version 1 is 21 × 21 modules and each version adds 4 modules per side, up to 177 × 177 at version 40, so a version V code is 17 + 4V modules across.
- Short URLA short URL is a brief web address, such as example.com/r/A7K2Q9, that a server forwards to a longer destination; dynamic QR codes encode one so the printed pattern stays small and the destination can change without reprinting.
- GS1 Digital LinkGS1 Digital Link is a GS1 standard for writing product identifiers, such as a GTIN with an optional batch or serial number, as an ordinary web address, so one QR code can open a page for shoppers and also give the product number to checkout and supply-chain scanners.
- Mask patternA mask pattern is one of eight fixed patterns that a QR encoder combines with the data area, flipping selected modules, so the finished code avoids large solid blocks, long runs and shapes that look like finder patterns, all of which make a code harder to scan.
Learn more
- QR code size guide: Why fewer modules means an easier scan.
- Free URL QR code generator: Turn any web address into a static code.
Sources
Last updated . Written by the CirculateQR team; technical facts follow the sources listed above. Example codes and sizes are computed with the open-source qrcode encoder that CirculateQR uses. Spotted something wrong? Email support@circulateqr.com. QR Code is a registered trademark of DENSO WAVE INCORPORATED.
← Browse the full glossary