How to use the Base 4 to Binary tool
- Enter a quaternary number using the digits 0 to 3 in the Base-4 number box, or select Example to load 231.
- Select Convert to expand the digits.
- Read the binary digits in the Result box. The example 231 becomes 101101.
- Select Copy to copy the bits, or Clear to reset the box.
Why base 4 to binary is a direct mapping
Four is two squared. That means one quaternary digit holds exactly the same information as two bits, and the conversion can be done one digit at a time. Replace each digit with its two-bit pattern from the list below and join the pairs.
- 0 becomes 00.
- 1 becomes 01.
- 2 becomes 10.
- 3 becomes 11.
Worked example: 3120 and 1032
Split 3120 into digits and substitute: 3 is 11, 1 is 01, 2 is 10 and 0 is 00. Joined together that is 11011000, which is 216 in decimal.
Now try 1032. The pairs are 01 00 11 10, eight bits in total. The value is 78, and the tool prints 1001110, seven bits, because the zero at the front of the first pair is dropped. Add it back if you need an even number of bits.
3120 -> 11 01 10 00 -> 11011000
1032 -> 01 00 11 10 -> 1001110Input rules for the base 4 converter
The tool reaches the pair-by-pair answer by a different route. It computes the numeric value of the input with exact integer arithmetic and prints that value in base 2. The one visible difference is at the left edge, where the result has no leading zeros.
The Base-4 number box takes one whole number. Whitespace around it is trimmed. A leading minus sign is allowed and carries through to the result, so -33 gives -1111. The digits 4 through 9, letters, spaces between digits and decimal points all produce an Invalid base-4 digit message that names the offending character. The input may be up to 4,096 characters long, which yields at most 8,192 bits.
Where two-bit symbols appear in practice
Any system that packs information two bits at a time is quaternary underneath. Genomics tools store the four DNA bases A, C, G and T as two-bit codes. QPSK radio modulation and PAM-4 signaling on high-speed serial links send one of four symbols per interval, so each symbol carries two bits.
Multi-level flash memory that stores two bits per cell uses four charge levels for the same reason. When you debug formats like these, writing a value in base 4 shows each symbol as one digit, and converting to binary shows the underlying bit pairs.
Frequently asked questions
How many bits is one base 4 digit?
Exactly two. Base 4 has four digit values, and two bits have four combinations, so the digits 0, 1, 2 and 3 correspond to 00, 01, 10 and 11.
Why does my result have an odd number of bits?
The tool prints the value without leading zeros. When the first quaternary digit is 1, its pair 01 loses the leading 0, leaving an odd count. The number is still correct: 1032 in base 4 is 1001110 in binary.
What is 231 in base 4 as a binary number?
It is 101101. The digit pairs are 10, 11 and 01. In decimal the value is 2 × 16 + 3 × 4 + 1 = 45.
Can base 4 numbers contain the digit 4?
No. A base uses digits from 0 up to one less than the base, so base 4 stops at 3. Entering 124, for example, returns Invalid base-4 digit: 4.
Is quaternary related to hexadecimal?
Yes. Two quaternary digits make one hexadecimal digit, because both cover four bits. The value 3120 in base 4 groups as 31 and 20, which are D and 8, giving D8 in hex and 11011000 in binary.
Does the conversion run in my browser?
Yes. The number is parsed and converted by JavaScript on the page. No request carrying your input is made.