Binary to Ternary Converter
Convert binary (base-2) numbers to ternary (base-3) and back instantly. Supports arbitrarily large numbers with step-by-step breakdown.
Step-by-step breakdown
About
Radix conversion between base-2 and base-3 is a non-trivial operation because 3 is not a power of 2. You cannot simply regroup digits. Each conversion requires full positional arithmetic: the source string must be evaluated as N = kโi=0 di โ bi, then decomposed by repeated division in the target base. A single misread bit in binary propagates unpredictably through every ternary digit. This tool uses native BigInt arithmetic to handle inputs of thousands of digits without the precision ceiling of IEEE 754 double-precision floats, which silently corrupt integers beyond 253. It approximates nothing. Every digit is exact.
Formulas
A number N represented in base b1 as digits dkdkโ1โฆd1d0 has the decimal value:
To convert N into base b2, perform repeated Euclidean division:
The remainders r, read in reverse order of computation, form the digits in base b2. For binary (b1 = 2) to ternary (b2 = 3), the intermediate value N is computed via Horner's method to avoid explicit exponentiation:
Where di โ {0, 1} for binary and r โ {0, 1, 2} for ternary output. The digit count in the target base is floor(logb2(N)) + 1. This tool uses BigInt internally, so precision is unlimited.
Reference Data
| Decimal | Binary (Base-2) | Ternary (Base-3) | Octal (Base-8) | Hex (Base-16) |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 | 1 |
| 2 | 10 | 2 | 2 | 2 |
| 3 | 11 | 10 | 3 | 3 |
| 4 | 100 | 11 | 4 | 4 |
| 5 | 101 | 12 | 5 | 5 |
| 6 | 110 | 20 | 6 | 6 |
| 7 | 111 | 21 | 7 | 7 |
| 8 | 1000 | 22 | 10 | 8 |
| 9 | 1001 | 100 | 11 | 9 |
| 10 | 1010 | 101 | 12 | A |
| 15 | 1111 | 120 | 17 | F |
| 16 | 10000 | 121 | 20 | 10 |
| 20 | 10100 | 202 | 24 | 14 |
| 27 | 11011 | 1000 | 33 | 1B |
| 32 | 100000 | 1012 | 40 | 20 |
| 42 | 101010 | 1120 | 52 | 2A |
| 64 | 1000000 | 2101 | 100 | 40 |
| 81 | 1010001 | 10000 | 121 | 51 |
| 100 | 1100100 | 10201 | 144 | 64 |
| 128 | 10000000 | 11202 | 200 | 80 |
| 243 | 11110011 | 100000 | 363 | F3 |
| 255 | 11111111 | 100110 | 377 | FF |
| 256 | 100000000 | 100111 | 400 | 100 |
| 512 | 1000000000 | 200222 | 1000 | 200 |
| 729 | 1011011001 | 1000000 | 1331 | 2D9 |
| 1000 | 1111101000 | 1101001 | 1750 | 3E8 |
| 1024 | 10000000000 | 1102011 | 2000 | 400 |