Ternary (Base 3) to Base 32 Converter
Convert ternary numbers to base 32.
100110 (base 3) = 7V (base 32)
Digits in base 3: 0 to 2. Digits in base 32: 0 to 9 and A to V.
How to convert Ternary to Base 32
Every positional number system works the same way: a digit is worth its own value times the base raised to the power of its position. In base 3 the place values, from the right, are 30 = 1, 31 = 3, 32 = 9 and so on.
Most pairs have no direct trick, so go through decimal, the base we all calculate in. First turn the base 3 number into decimal, then divide by 32 and read the remainders from the bottom up. Two short steps, and you can check the number in the middle.
The method
decimal value = each digit × its place value, all added upplace values in base 3: 1, 3, 9, 27, 81, and so ondivide by 32, keep the remainder, repeat until the quotient is 0the answer is the remainders read from last to firstdigits in base 3: 0 to 2digits in base 32: 0 to 9 and A to V
Worked example 1: 1200 from ternary to base 32
Step 1: base 3 to decimal1200 (base 3) = 1 × 33 + 2 × 32= 27 + 18= 45Step 2: decimal to base 3245 ÷ 32 = 1 remainder 13 (D)1 ÷ 32 = 0 remainder 1Read the remainders from the bottom up: 1D1200 (base 3) = 1D (base 32)
Letters stand for values from 10 up: A = 10, B = 11, C = 12 and so on. Remainders come out last digit first, which is why you read them from the bottom up. Digits that are 0 add nothing to the sum, so they are left out of the expansion.
Worked example 2: 100110 from ternary to base 32
Step 1: base 3 to decimal100110 (base 3) = 1 × 35 + 1 × 32 + 1 × 31= 243 + 9 + 3= 255Step 2: decimal to base 32255 ÷ 32 = 7 remainder 31 (V)7 ÷ 32 = 0 remainder 7Read the remainders from the bottom up: 7V100110 (base 3) = 7V (base 32)
Worked example 3: 1101001 from ternary to base 32
Step 1: base 3 to decimal1101001 (base 3) = 1 × 36 + 1 × 35 + 1 × 33 + 1 × 30= 729 + 243 + 27 + 1= 1,000Step 2: decimal to base 321,000 ÷ 32 = 31 remainder 831 ÷ 32 = 0 remainder 31 (V)Read the remainders from the bottom up: V81101001 (base 3) = V8 (base 32)
Need the other direction? Open the Base 32 to Ternary converter.
Ternary to Base 32 examples
The decimal number 255 is written 100110 in ternary and 7V in base 32.
| Ternary | Base 32 | Decimal |
|---|---|---|
| 1 | 1 | 1 |
| 2 | 2 | 2 |
| 21 | 7 | 7 |
| 22 | 8 | 8 |
| 101 | A | 10 |
| 120 | F | 15 |
| 121 | G | 16 |
| 1012 | 10 | 32 |
| 2101 | 20 | 64 |
| 10201 | 34 | 100 |
| 100110 | 7V | 255 |
| 1101001 | V8 | 1000 |
Where Ternary to Base 32 comes up
Ternary uses the digits 0, 1 and 2, and each ternary digit (a trit) carries about 1.58 bits of information. Ternary is rare in real hardware, though the Soviet Setun computer of 1958 used a balanced ternary design. Today it shows up mostly in computer science courses and puzzles.
Base 32 here uses 0 to 9 and A to V, and each digit stands for exactly five bits. It is handy for compact IDs. The text encodings called Base32 in RFC 4648 work on bytes and use their own alphabets, so their output is not the same as converting a whole number.
Going to a larger base packs more value into each digit, so the result is shorter. The number 255 needs 6 digits in ternary and 2 in base 32.
Ternary to Base 32 FAQ
How do I convert ternary to base 32?
Convert to decimal first by adding up each digit times its place value, then divide that decimal number by 32 repeatedly and read the remainders from last to first.
Which digits does ternary use?
Base 3 uses the digits 0 to 2. For example, 3 is not a valid digit in base 3.
Will the base 32 number be longer or shorter?
Shorter. Going to a larger base packs more value into each digit, so the result is shorter. Roughly 0.32 base 32 digits for every ternary digit. The number 255 needs 6 digits in ternary and 2 in base 32.
What is 100110 in base 32?
100110 in ternary is 7V in base 32. Both are the decimal number 255.
Can I convert negative numbers or fractions?
The converter handles whole numbers, and a leading minus sign works for negatives. Fractions use a different method, where you repeatedly multiply the fractional part by the new base, and they are not supported here.