Decimal (Base 10) to Ternary (Base 3) Converter

Convert decimal numbers to ternary.

100110

255 (base 10) = 100110 (base 3)

Digits in base 10: 0 to 9. Digits in base 3: 0 to 2.

How to convert Decimal 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 10 the place values, from the right, are 100 = 1, 101 = 10, 102 = 100 and so on.

To get from decimal to base 3, divide the number by 3 over and over. Every remainder is one digit of the answer, starting with the last digit, so you read the remainders from the bottom up.

The method

divide by 3, keep the remainder, repeat until the quotient is 0the answer is the remainders read from last to firstdigits in base 10: 0 to 9digits in base 3: 0 to 2

Worked example 1: 45 from decimal to ternary

45 ÷ 3 = 15 remainder 015 ÷ 3 = 5 remainder 05 ÷ 3 = 1 remainder 21 ÷ 3 = 0 remainder 1Read the remainders from the bottom up: 120045 (base 10) = 1200 (base 3)

Remainders come out last digit first, which is why you read them from the bottom up.

Worked example 2: 255 from decimal to ternary

255 ÷ 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: 100110255 (base 10) = 100110 (base 3)

Worked example 3: 1000 from decimal to ternary

1,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: 11010011000 (base 10) = 1101001 (base 3)

Need the other direction? Open the Ternary to Decimal converter.

Decimal to Ternary examples

The decimal number 255 is written 255 in decimal and 100110 in ternary.

Common Decimal to Ternary values
DecimalTernary
11
22
721
822
10101
15120
16121
321012
642101
10010201
255100110
10001101001

Where Decimal to Ternary comes up

Decimal is the base 10 system everyone learns first, with the digits 0 to 9. It is the form people read: prices, measurements, ages and IDs. It is also the base we calculate in by hand, which is why the worked steps on this page pass through decimal.

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 decimal and 6 in ternary.

Decimal to Ternary FAQ

How do I convert decimal to ternary?

Divide the decimal number by 3, write down the remainder, and repeat with the quotient until it reaches 0. The remainders, read from last to first, are the base 3 number.

Which digits does decimal use?

Base 10 uses the digits 0 to 9. For example, A is not a valid digit in base 10.

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 2.1 ternary digits for every decimal digit. The number 255 needs 3 digits in decimal and 6 in ternary.

What is 255 in ternary?

255 in decimal 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.