CIRCULATEQR

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:

The four main encoding modes (ISO/IEC 18004)
ModeCharactersBits
Numeric0–910 per 3 digits (about 3.3 per digit)
Alphanumeric0–9, A–Z (capitals only), space and $ % * + - . / :11 per 2 characters (5.5 per character)
ByteAny 8-bit data8 per byte
KanjiShift JIS double-byte characters13 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).

Learn more

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