## 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 three-digit number into 10 binary bits. If a group starts with a zero, it should be interpreted as a two-digit number and you should convert it to 7 binary bits, and if there are two zeroes at the beginning of a group, it should be interpreted as a one-digit number and you should convert it to 4 binary bits. Similarly, if the final group consists of only two digits, you should convert it to 7 binary bits, and if the final group consists of only one digit, you should convert it to 4 binary bits.

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.