Octal (Base 8) to Ternary (Base 3) Converter
Convert octal numbers to ternary.
377 (base 8) = 100110 (base 3)
Digits in base 8: 0 to 7. Digits in base 3: 0 to 2.
How to convert Octal to Ternary
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 8 the place values, from the right, are 80 = 1, 81 = 8, 82 = 64 and so on.
Most pairs have no direct trick, so go through decimal, the base we all calculate in. First turn the base 8 number into decimal, then divide by 3 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 8: 1, 8, 64, 512, 4096, and so ondivide by 3, keep the remainder, repeat until the quotient is 0the answer is the remainders read from last to firstdigits in base 8: 0 to 7digits in base 3: 0 to 2
Worked example 1: 55 from octal to ternary
Step 1: base 8 to decimal55 (base 8) = 5 × 81 + 5 × 80= 40 + 5= 45Step 2: decimal to base 345 ÷ 3 = 15 remainder 015 ÷ 3 = 5 remainder 05 ÷ 3 = 1 remainder 21 ÷ 3 = 0 remainder 1Read the remainders from the bottom up: 120055 (base 8) = 1200 (base 3)
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: 377 from octal to ternary
Step 1: base 8 to decimal377 (base 8) = 3 × 82 + 7 × 81 + 7 × 80= 192 + 56 + 7= 255Step 2: decimal to base 3255 ÷ 3 = 85 remainder 085 ÷ 3 = 28 remainder 128 ÷ 3 = 9 remainder 19 ÷ 3 = 3 remainder 03 ÷ 3 = 1 remainder 01 ÷ 3 = 0 remainder 1Read the remainders from the bottom up: 100110377 (base 8) = 100110 (base 3)
Worked example 3: 1750 from octal to ternary
Step 1: base 8 to decimal1750 (base 8) = 1 × 83 + 7 × 82 + 5 × 81= 512 + 448 + 40= 1,000Step 2: decimal to base 31,000 ÷ 3 = 333 remainder 1333 ÷ 3 = 111 remainder 0111 ÷ 3 = 37 remainder 037 ÷ 3 = 12 remainder 112 ÷ 3 = 4 remainder 04 ÷ 3 = 1 remainder 11 ÷ 3 = 0 remainder 1Read the remainders from the bottom up: 11010011750 (base 8) = 1101001 (base 3)
Need the other direction? Open the Ternary to Octal converter.
Octal to Ternary examples
The decimal number 255 is written 377 in octal and 100110 in ternary.
| Octal | Ternary | Decimal |
|---|---|---|
| 1 | 1 | 1 |
| 2 | 2 | 2 |
| 7 | 21 | 7 |
| 10 | 22 | 8 |
| 12 | 101 | 10 |
| 17 | 120 | 15 |
| 20 | 121 | 16 |
| 40 | 1012 | 32 |
| 100 | 2101 | 64 |
| 144 | 10201 | 100 |
| 377 | 100110 | 255 |
| 1750 | 1101001 | 1000 |
Where Octal to Ternary comes up
Octal uses the digits 0 to 7, and each octal digit stands for exactly three bits. Unix file permissions such as chmod 755 are written in octal, and it also appears in older machine listings where word sizes divide by three.
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.
Going to a smaller base spreads the same value over more digits, so the result is longer. The number 255 needs 3 digits in octal and 6 in ternary.
Octal to Ternary FAQ
How do I convert octal to ternary?
Convert to decimal first by adding up each digit times its place value, then divide that decimal number by 3 repeatedly and read the remainders from last to first.
Which digits does octal use?
Base 8 uses the digits 0 to 7. For example, 8 is not a valid digit in base 8.
Will the ternary number be longer or shorter?
Longer. Going to a smaller base spreads the same value over more digits, so the result is longer. Roughly 1.89 ternary digits for every octal digit. The number 255 needs 3 digits in octal and 6 in ternary.
What is 377 in ternary?
377 in octal is 100110 in ternary. 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.