Hexadecimal (Base 16) to Ternary (Base 3) Converter

Convert hexadecimal numbers to ternary.

100110

FF (base 16) = 100110 (base 3)

Digits in base 16: 0 to 9 and A to F. Digits in base 3: 0 to 2.

How to convert Hexadecimal 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 16 the place values, from the right, are 160 = 1, 161 = 16, 162 = 256 and so on.

Most pairs have no direct trick, so go through decimal, the base we all calculate in. First turn the base 16 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 16: 1, 16, 256, 4096, 65536, 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 16: 0 to 9 and A to Fdigits in base 3: 0 to 2

Worked example 1: 2D from hexadecimal to ternary

Step 1: base 16 to decimal2D (base 16) = 2 × 161 + 13 × 160= 32 + 13= 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: 12002D (base 16) = 1200 (base 3)

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: FF from hexadecimal to ternary

Step 1: base 16 to decimalFF (base 16) = 15 × 161 + 15 × 160= 240 + 15= 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: 100110FF (base 16) = 100110 (base 3)

Worked example 3: 3E8 from hexadecimal to ternary

Step 1: base 16 to decimal3E8 (base 16) = 3 × 162 + 14 × 161 + 8 × 160= 768 + 224 + 8= 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: 11010013E8 (base 16) = 1101001 (base 3)

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

Hexadecimal to Ternary examples

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

Common Hexadecimal to Ternary values
HexadecimalTernaryDecimal
111
222
7217
8228
A10110
F12015
1012116
20101232
40210164
6410201100
FF100110255
3E811010011000

Where Hexadecimal to Ternary comes up

Hexadecimal (base 16) uses 0 to 9 and A to F, and each hex digit stands for exactly four bits, so one byte is always two hex digits. You see it in web colours like #FF8800, memory addresses, MAC addresses, hash values and byte dumps.

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 2 digits in hexadecimal and 6 in ternary.

Hexadecimal to Ternary FAQ

How do I convert hexadecimal 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 hexadecimal use?

Base 16 uses the digits 0 to 9 and A to F. For example, G is not a valid digit in base 16. Letters are not case sensitive on this converter, and results are shown in capitals.

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.52 ternary digits for every hexadecimal digit. The number 255 needs 2 digits in hexadecimal and 6 in ternary.

What is FF in ternary?

FF in hexadecimal 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.