Binary to Base 5 (Quinary) Converter – Free

This binary to base 5 converter takes a number in bits and returns it in quinary, where the positions are worth 1, 5, 25, 125 and higher powers of five.

How to use the Binary to Base 5 tool

  1. Put the bit string in the Binary number box, with an optional minus sign in front.
  2. Select Convert to calculate the quinary digits.
  3. Read the base-5 number in the Result box. Only the digits 0 to 4 appear.
  4. Select Copy to take the number, or Example to see 101101 converted.

The quinary number system

Base 5 uses five digits, 0 through 4. Moving one position to the left multiplies the weight by five, so the number 140 in base 5 means one 25, four 5s and no units. Counting by fives is old and familiar: tally marks are bundled in fives, and one hand counts to five.

Quinary also sits inside decimal. Each rod of a Japanese soroban has one bead worth five and four beads worth one, and the bi-quinary code used by machines such as the IBM 650 stored a decimal digit as a two-state part and a five-state part.

Binary to base 5 by repeated division

Five shares no factor with two, so there is no way to translate groups of bits into quinary digits. The method is to divide the value by five until nothing is left.

For the sample 101101, which is 45: 45 / 5 = 9 remainder 0, 9 / 5 = 1 remainder 4, and 1 / 5 = 0 remainder 1. Reading the remainders from the last to the first gives 140. Check: 25 + 20 + 0 = 45.

101101  ->  140
1100100  ->  400      (100 = 4 x 25)
110001  ->  144       (49)
1111101000  ->  13000 (1000)

Checking a base-5 result

The last quinary digit is the remainder after dividing by five. A result ending in 0 is a multiple of 5, one ending in 00 is a multiple of 25, and one ending in 000 is a multiple of 125. One thousand is 8 x 125, and 8 in base 5 is 13, which is why 1111101000 converts to 13000.

The result is always shorter than the input. A quinary digit carries about 2.32 bits, so expect roughly 43 base-5 digits for every 100 bits.

Input rules and error messages

The tool expects a single whole number. These are the cases it checks.

  • An empty box returns: Enter a base-2 whole number.
  • A character other than 0 or 1, including a space in the middle, returns Invalid base-2 digit and shows the character.
  • More than 4,096 characters returns: Enter at most 4,096 digits.
  • A 0b prefix is skipped, and a leading minus sign carries through to the result.

Frequently asked questions

What is base 5 called?

It is called quinary. You may also see the term pental. Both mean a positional system with radix five and the digits 0, 1, 2, 3 and 4.

How do I convert binary to base 5 by hand?

Convert the binary number to decimal, divide by 5, and note the remainder. Keep dividing the quotient by 5 until it reaches zero. The remainders in reverse order are the base-5 digits.

Why can't I map bits directly to base-5 digits?

Direct mapping needs the target base to be a power of two. Five is not, so a group of bits never lines up with a whole number of quinary digits. The full value has to be converted.

Does the converter round large numbers?

No. It uses arbitrary-precision integers, so every digit of the output is exact, even for inputs thousands of bits long.

How do I convert base 5 back to binary?

Use the Base 5 to Binary tool. It reads digits 0 to 4 and returns the same value in bits, so 140 becomes 101101 again.

Related tools