How to use the Binary to Base 3 tool
- Type the base-2 value into the Binary number box as one unbroken string of 0s and 1s.
- Select Convert to rewrite the value in ternary.
- Read the base-3 digits in the Result box.
- Select Copy to take the answer, or Clear to start over.
How ternary numbers work
A ternary digit, sometimes called a trit, has three states. The positions are worth 1, 3, 9, 27, 81, 243 and so on. One trit carries about 1.585 bits of information, so a ternary number has roughly 63% as many digits as the same number in binary.
This tool outputs standard ternary with the digits 0, 1 and 2. Balanced ternary is a different notation that uses the digit values -1, 0 and +1 and needs no minus sign. The Soviet Setun computer of 1958 used balanced ternary. The tool does not produce that form.
Binary to base 3: a worked example
The sample input 101101 equals 45. The largest power of three that fits is 27, and it fits once, leaving 18. Nine fits twice, leaving 0. So the digits for 27, 9, 3 and 1 are 1, 2, 0 and 0, and the result is 1200.
You can also divide by three repeatedly and read the remainders from the bottom up: 45 / 3 = 15 r 0, 15 / 3 = 5 r 0, 5 / 3 = 1 r 2, 1 / 3 = 0 r 1. That again gives 1200.
101101 -> 1200
1010001 -> 10000 (81 is 3 to the 4th power)
11111111 -> 100110
-101101 -> -1200Patterns worth knowing
Powers of three look like powers of two do in binary: a 1 followed by zeros. Eighty-one is 10000 in ternary. A number is divisible by three exactly when its last ternary digit is 0, and by nine when the last two are 00.
There is no bit-grouping shortcut between base 2 and base 3 because neither radix is a power of the other. Three bits can hold eight values, which is not a whole number of trits. The converter therefore works on the full integer value.
What the converter accepts
Enter a single whole number. An optional minus sign may come first, followed by an optional 0b prefix, followed by the bits. The tool rejects spaces inside the number, the digit 2 and above, and a binary point, naming the first invalid character in its message.
Leading zeros are ignored. The longest input is 4,096 characters, and the arithmetic is exact at that length. For the reverse direction, use the Base 3 to Binary tool.
Frequently asked questions
What digits can appear in a base-3 result?
Only 0, 1 and 2. If you see a 2 in the output, that is correct: it means two of that power of three. Negative results begin with a minus sign.
How do I convert binary to ternary by hand?
Find the decimal value first, then divide by 3 repeatedly and write down each remainder. The remainders, read from the last one to the first, are the ternary digits.
Does this tool output balanced ternary?
No. It outputs ordinary ternary with digits 0, 1 and 2 and a minus sign for negative values. Balanced ternary uses digit values of -1, 0 and 1 and would need a separate conversion.
Why is the ternary number shorter than the binary one?
Each ternary digit distinguishes three values where a bit distinguishes two. The digit count shrinks by a factor of about 0.63, so a 32-bit number needs at most 21 ternary digits.
Where is base 3 used in computing?
Ternary shows up in ternary search trees, in three-state signals, in analysis of the Cantor set, and in puzzles that weigh coins on a balance. Historic ternary computers also existed.