Decimal to ternary (base 3) converter

Type a decimal number and see it in ternary (base 3) right away, with the working shown. Useful for math and computer science students checking an exercise.

Loading the tool…

Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.

How to use it

  1. Enter decimal number.
  2. The result appears straight away and updates as you edit.
  3. Copy the result, or copy a link that keeps the same values to share it.

How it is calculated

Repeated division: n = q × 3 + r, where the remainder r (0 to 2) is the next digit from the right; repeat on q until it reaches 0. Example: 2026 = 2210001 in base 3.

Example

Inputs: Decimal number = 2026. Result: Result in base 3: 2210001; Number of digits: 7.

2026
2210001

Limits and caveats

  • Whole numbers only, up to 1000 digits. For fractions use the fractional base converter.
  • The step table appears when the result has 60 digits or fewer.

Questions about this tool

How do I convert decimal to ternary by hand?

Divide by 3 and write down the remainder, then divide the quotient by 3 again until it reaches 0, and read the remainders from last to first. For example 2026 becomes 2210001.

What is balanced ternary?

A variant that uses the digits 1, 0 and -1 instead of 0, 1 and 2, so negative numbers need no minus sign. The Soviet Setun computer used it in 1958, and this tool shows it as an extra result where T stands for -1.

Does it handle large and negative numbers?

Yes. It uses exact whole-number math up to 1000 digits with no rounding, and the result uses the digits 0 to 2. A negative number is converted by its absolute value and keeps its minus sign.