Skip to main content

Numeric Mode Encoding

To illustrate numeric mode encoding, the example input is 8675309, encoded in a version 1 QR code.

Step 1: Break String Up Into Groups of Three

To encode a string of digits in numeric mode, first split the string into groups of three digits. If the string's length is not a multiple of 3, the final group of digits will have to be only one or two numbers long.

After splitting into groups of three:
867 530 9

Step 2: Convert each group into binary

Now treat each group of digits as a three digit number (or fewer than three, if the final group is two or one digits long). Convert that number into binary. If the group starts with a zero, it should be interpreted as a two-digit number, and if there are two zeroes at the beginning of the group, it should be interpreted as a one-digit number.

Converting to binary:

867 → 1101100011

530 → 1000010010

9 → 1001

Next: Finish the Data Encoding Step

Follow the instructions on the data encoding page to add any remaining bits as necessary.