Binary to Base 9 (Nonary) Converter – Free

This binary to base 9 converter rewrites a whole number given in bits as a nonary number. The digits 0 to 8 are used, and the value is preserved exactly.

How to use the Binary to Base 9 tool

  1. Enter a whole number in bits in the Binary number box. Spaces inside the number are not accepted.
  2. Select Convert to compute the nonary form.
  3. Read the base-9 digits in the Result box.
  4. Select Copy to take the digits, or Example to try 101101.

How base 9 relates to base 3

Nine is three squared. That gives nonary the same role for ternary that hexadecimal has for binary: a compact way to write it. Each base-9 digit stands for exactly two base-3 digits, from 00 for 0 up to 22 for 8.

There is no such link to binary. A bit pattern has to be converted through its numeric value, with place values 1, 9, 81, 729 and 6,561 on the nonary side.

Worked example: from binary to base 9

The sample 101101 is 45, and 45 is exactly five nines, so the result is 50. You can confirm it through ternary. In base 3 the same number is 1200. Split that into pairs, 12 and 00. The pair 12 is 1 x 3 + 2 = 5 and the pair 00 is 0, giving 50 again.

The same check works for 11111111, which is 255. Its ternary form is 100110. The pairs 10, 01 and 10 are 3, 1 and 3, and the converter returns 313.

101101  ->  50
1010001  ->  100     (81 is 9 squared)
11111111  ->  313
10000000000  ->  1357

Reading and checking nonary output

A nonary number ending in 0 is a multiple of nine. If it ends in 0, 3 or 6, the value is a multiple of three. To verify a result by hand, expand it: 1357 is 1 x 729 + 3 x 81 + 5 x 9 + 7, which is 729 + 243 + 45 + 7 = 1,024, the value of a 1 followed by ten zero bits.

A base-9 digit carries about 3.17 bits, so the result has a bit less than a third as many digits as the binary input. Since the digit 9 never appears, any 9 in a supposed nonary value is a sign that it is really decimal.

Format of the binary input

The box takes a single whole number. A minus sign in front is allowed and is kept in the output. The 0b prefix used in source code is accepted. Characters other than 0 and 1 stop the conversion, and the error message quotes the first one found. The input may be up to 4,096 characters, and leading zeros have no effect on the result.

Frequently asked questions

What is base 9 called?

It is called nonary. It is a positional number system with nine digits, 0 to 8, in which each place is worth nine times the place to its right.

How do I convert binary to base 9 by hand?

Convert to decimal, then divide by 9 repeatedly and collect the remainders in reverse. Alternatively convert to base 3 first, pair the ternary digits from the right, and replace each pair with one nonary digit.

Why does 101101 become 50 in base 9?

101101 is 45 in decimal, and 45 equals 5 x 9 + 0. The nines digit is 5 and the units digit is 0, so the base-9 form is 50.

What is base 9 used for?

Mainly as shorthand for ternary data, in the way hex is shorthand for binary. It also appears in number theory exercises and in puzzles built on nine symbols.

Can I convert a negative binary number?

Yes. Write it with a leading minus sign. The tool converts the magnitude and puts the sign back, so -101101 gives -50. Two's complement patterns are not interpreted as negative.

Related tools