How to use the Binary to Base 4 tool
- Enter the number in the Binary number box. Do not put spaces between the bits.
- Select Convert to produce the quaternary form.
- Read the base-4 digits in the Result box and compare them with the bit pairs of your input.
- Select Copy to take the value, or Example to convert 101101.
Why base 4 is easy to get from binary
Four is two squared, so each quaternary digit holds exactly two bits: 00 is 0, 01 is 1, 10 is 2 and 11 is 3. Converting needs no arithmetic. Split the bits into pairs starting from the right, add a leading zero if the count is odd, and replace each pair with its digit.
It is the same relationship that octal has with groups of three bits and hexadecimal has with groups of four. Base 4 is the smallest radix where this works.
Binary to base 4 worked example
For 101101 the pairs are 10, 11 and 01, which are the digits 2, 3 and 1. The result is 231. As a check, 2 x 16 + 3 x 4 + 1 = 45, the same value as the binary input.
The seven-bit number 1100100 has an odd length, so it is read as 01 10 01 00. Those pairs give 1210, which is 64 + 32 + 4 + 0 = 100.
101101 -> 231
1100100 -> 1210
11111111 -> 3333
10000000000 -> 100000Where quaternary digits appear
Any system with four symbols per position is base 4 in disguise. The cases developers run into most often are listed here.
- DNA sequences. The four nucleotides A, C, G and T are commonly packed as two bits each.
- Modulation schemes such as QPSK and PAM-4, where each transmitted symbol carries two bits.
- Quadtrees. Each level picks one of four quadrants, so a path from the root is a base-4 string. Map tile quadkeys are built this way.
- Two-bit fields in hardware registers, where a base-4 digit names the field value directly.
Input format and limits
The converter reads one whole number of up to 4,096 characters. It accepts an optional leading minus sign and an optional 0b prefix. A space, a digit other than 0 or 1, or a binary point causes an Invalid base-2 digit message.
The output is the numeric value in base 4, so leading zeros are not kept. An input of 000111 gives 13, not 013. If you need a fixed number of digits for a table or a key, pad the result yourself.
Frequently asked questions
How do I convert binary to base 4 quickly?
Pair the bits from the right and translate each pair: 00 to 0, 01 to 1, 10 to 2, 11 to 3. If one bit is left over at the left end, treat it as 00 or 01.
Why is the base-4 result half the length of the binary?
Each quaternary digit replaces two bits. An 8-bit value fits in four base-4 digits and a 32-bit value fits in sixteen.
What happens to leading zeros?
They are dropped, because the tool converts the value and not the string. 00101101 and 101101 both return 231. Count the digits and pad on the left if your format needs a fixed width.
Is base 4 the same as 2-bit encoding?
In effect, yes. A base-4 digit and a 2-bit field carry the same information, which is why DNA bases and four-level signals are described both ways.
Can the tool convert negative binary numbers to base 4?
Yes, when the number is written with a minus sign, such as -101101, which returns -231. It does not interpret a leading 1 bit as a two's complement sign.