Overview
Numeric Mode is one of the four data encoding modes defined in the QR Code standard (ISO/IEC 18004). It is specifically designed for encoding sequences of numeric characters (0 through 9). When a QR code contains only numeric data, the encoder can use Numeric Mode to reduce the size of the encoded data, resulting in a more compact QR code with improved scanning reliability and faster processing.
Developers working with QR code generation, particularly in systems that generate dynamic or static links, must understand Numeric Mode to optimize QR code size and performance. It is especially useful when creating QR codes for data such as product IDs, account numbers, or transaction codes that are entirely numeric.

Why It Matters
For developers building QR code systems, Numeric Mode is a performance and reliability optimization. Using Numeric Mode reduces the number of bits required to encode numeric data compared to other modes like Alphanumeric or Byte Mode. This leads to smaller QR codes, which in turn improve print quality, scanning speed, and overall user experience, particularly in environments with low contrast or high noise.
For PixQR users, Numeric Mode ensures that numeric data is encoded efficiently, reducing the risk of misreads and improving the robustness of generated QR codes. This is especially important in high-volume scanning environments or applications where QR code reliability is critical, such as inventory tracking or payment systems.
How It Works
The QR code encoding process begins by analyzing the input data and selecting the most appropriate encoding mode. For numeric data, Numeric Mode is chosen when the input consists exclusively of digits (0–9). The mode uses a 10-digit alphabet to represent data, with each group of three digits encoded using 10 bits. This allows for efficient encoding of numeric sequences.
- Each group of three digits is represented by 10 bits, enabling high compression for numeric data.
- Numeric Mode supports input lengths of 1, 2, or 3 digits per group, depending on the number of digits remaining in the input.
- When the input contains fewer than three digits, the mode pads the remaining bits to ensure proper alignment.
- The encoder automatically switches to Numeric Mode when it detects a sequence of digits at the start of the input.
- Numeric Mode is not applicable to mixed data types or non-numeric characters, which would trigger a switch to other modes.
Quick Reference
| Item | Purpose | Notes |
|---|---|---|
| Encoding Mode | Selects Numeric Mode for numeric-only input | Used during QR code generation |
| Bit Efficiency | 10 bits per 3 digits | More efficient than other modes |
| Input Validation | Requires all numeric characters | Non-numeric input triggers mode switch |
| Grouping | Groups of 3 digits | Final group may be 1 or 2 digits |
| Performance Impact | Smaller QR codes | Improves scanning and print reliability |
Basic Example
PixQR Example QR
This QR links directly to this glossary page, so printed notes, onboarding docs, and support material can bring scanners back to the current reference.
/glossary/qr-code-how-qr-codes-work/how-qr-codes-work-numeric-mode
This example demonstrates how Numeric Mode encodes a simple numeric sequence. The input "123456" is encoded using the 10-bit group method.
Input: 123456
Group 1: 123 → 10 bits
Group 2: 456 → 10 bits
Total: 20 bits
The example shows that each group of three digits is encoded using 10 bits, reducing the data size compared to other modes. This is the foundation of Numeric Mode efficiency.
Production Example
In a production environment, developers might use a QR code library that automatically selects Numeric Mode for numeric input. The following example illustrates how such a system might be configured to ensure optimal encoding.
const qrData = "9876543210";
const options = {
mode: "numeric",
version: 1,
errorCorrection: "M"
};
const qrCode = generateQR(qrData, options);
// Output: QR code with Numeric Mode encoding
This version is more suitable for production because it explicitly sets the mode, ensuring that numeric data is encoded efficiently. It also includes error correction settings, which are critical for reliable scanning in real-world conditions.
Common Mistakes
- Assuming all numeric data is automatically encoded in Numeric Mode without verifying input. This can lead to larger QR codes if the system defaults to a less efficient mode.
- Using Numeric Mode for mixed alphanumeric data, which causes the encoder to switch to a less efficient mode and increases QR code size.
- Not validating input to ensure only numeric characters are used. This can cause encoding failures or incorrect QR code generation.
- Ignoring performance benefits of Numeric Mode, resulting in suboptimal QR code generation for numeric inputs.
- Hardcoding mode selection without considering dynamic input types, which can lead to inconsistent QR code behavior.
Security And Production Notes
- Numeric Mode is secure for encoding numeric-only data, but it does not provide encryption or obfuscation. Sensitive data should be encoded using secure methods before being passed to QR generation.
- Input validation is critical when using Numeric Mode to prevent accidental mode switching due to unexpected characters.
- For high-volume scanning systems, Numeric Mode improves scanning reliability due to smaller QR code size and fewer bits to process.
- When generating QR codes for brand-safe applications, ensure Numeric Mode is used consistently for numeric data to maintain print quality and scanning performance.
- Using Numeric Mode in conjunction with error correction and appropriate QR code versions ensures robust performance in diverse scanning environments.
Related Concepts
Numeric Mode is part of a broader set of QR code encoding strategies. Related concepts include:
- Alphanumeric Mode – Used for alphanumeric data (0–9, A–Z, and a few special characters) with 11 bits per 2 characters.
- Byte Mode – Encodes raw binary data using 8 bits per character, suitable for mixed or non-numeric content.
- Shift JIS Mode – A mode for Japanese characters, used in specific regional contexts.
- ECI (Extended Channel Interpretation) – Allows specifying character sets for data beyond basic modes.
- QR Code Version – Defines the size and capacity of the QR code grid, which affects how modes are applied.