Balanced Ternary Converter — Decimal ↔ Base-3 with Digits {−1, 0, +1}

Convert any integer to and from balanced ternary — base 3 using the digit set {−1, 0, +1}, written T 0 1 (or − 0 +). Negative numbers need no minus sign. See the repeated-division steps and the positional expansion back to decimal, live in your browser.

Converter Number Systems Updated Jun 21, 2026
How to Use
  1. Type a whole number in the Decimal box to encode it as balanced ternary, or type a balanced-ternary string (e.g. 1TT) to decode it back to decimal.
  2. On input, T and − both mean the digit −1, while 1 and + both mean +1 — mix either notation freely.
  3. Toggle the digit style between T 0 1 and − 0 + to match the convention you prefer.
  4. Open “Show work” to follow the repeated divide-by-3 carry adjustment and the positional expansion.
  5. Click any value (or its Copy button) to copy it.
Any whole number, positive or negative.
Digits T 0 1 (T = −1). You may also type − and + .
Digit style

What balanced ternary is

Balanced ternary is base 3 with a twist: instead of the usual digits {0, 1, 2}, it uses the symmetric set {−1, 0, +1}. The columns are still the powers of three — 1, 3, 9, 27, 81 and so on — but because each digit can itself be negative, every integer has exactly one representation and no sign is ever needed. The digit −1 is conventionally written T (sometimes Z or ), so the number five is written 1TT, meaning 1·9 + (−1)·3 + (−1)·1 = 5. This tool converts both ways and shows the working, all in your browser.

How the conversion works

Decimal → balanced ternary is repeated division by 3 with a carry adjustment. Take the remainder r = n mod 3; if r is 0 or 1 keep it as the digit, but if r is 2, record the digit T (−1) instead and add 1 to the quotient to carry. Continue dividing the new quotient until it reaches zero, then read the recorded digits from last to first. Balanced ternary → decimal is plain positional expansion: multiply each digit (with T counting as −1) by its power of three and add the results. A neat bonus falls out of the symmetry — to negate a number you simply swap every 1 with T, so 1TT (5) becomes T11 (−5).

Why it is interesting

Balanced ternary is not just a curiosity. The Soviet Setun computer (1958) ran on it, exploiting the fact that negative numbers, rounding and sign tests all become simpler when zero sits in the middle of the digit range. It is also the secret behind the classic two-pan balance puzzle: with weights of 1, 3, 9 and 27 you can weigh any whole number of units up to 40, because each weight can sit on the opposite pan (+1), on the same pan as the object (−1), or be left off (0) — exactly the three balanced-ternary states.

Quick reference

Digit set
{ T=−1, 0, 1 }
Encode rule
r = n mod 3; r=2 → T, carry +1
Decode
Σ digit × 3ⁿ
5
= 1TT = 9 − 3 − 1
Negate
swap 1 ↔ T : 1TT → T11 (−5)
No sign needed
−5 = T11 directly

About the Balanced Ternary Converter — Decimal ↔ Base-3 with Digits {−1, 0, +1}

Working on everyday tasks? The Balanced Ternary Converter — Decimal ↔ Base-3 with Digits {−1, 0, +1} is a free browser tool that gives you the answer in seconds. Convert any integer to and from balanced ternary — base 3 using the digit set {−1, 0, +1}, written T 0 1 (or − 0 +). Negative numbers need no minus sign. See the repeated-division steps and the positional expansion back to decimal, live in your browser.

How it works

Type a value, then pick what you want to change it into. The answer appears straight away. It all happens on your own device, so it is fast and nothing you type is sent away. Just check that you picked the right “from” and “to” so you get the answer you wanted.

Want the deeper story? The Knowledge Base explains the ideas behind the tools in more detail.

Frequently Asked Questions

What is balanced ternary?

It is base 3, but instead of the digits {0, 1, 2} it uses {−1, 0, +1}. Each column is still a power of three (1, 3, 9, 27, …), yet because the digits are symmetric around zero, every integer — positive or negative — has a single representation and no separate sign is needed. The digit −1 is almost always written T (and sometimes Z or −), so 5 is written 1TT.

How do I convert a decimal number to balanced ternary?

Repeatedly divide by 3, but adjust the remainder so it lands in {−1, 0, +1}. Take r = n mod 3; if r is 2, record the digit −1 (T) and add 1 to the quotient to carry; otherwise record r (0 or 1). Then continue with the new quotient until it reaches zero. Reading the recorded digits from last to first gives the answer.

Why does balanced ternary not need a minus sign?

Because the digits themselves can be negative, the value of a number is just the sum of each digit times its power of three. Negating a number is as simple as swapping every 1 for a T and every T for a 1 — so 1TT (which is 5) becomes T11 (which is −5).

Where is balanced ternary actually used?

It is famous from the Soviet Setun computer (1958), which used balanced-ternary arithmetic. It also turns up in puzzles about weighing objects with a two-pan balance (each weight can go on the left pan, the right pan, or be left off — exactly the three states), and in efficient signed-digit number representations.

Is anything uploaded?

No. The entire conversion runs in your browser with JavaScript — nothing is sent to a server.

How do I use the Balanced Ternary Converter — Decimal ↔ Base-3 with Digits {−1, 0, +1}?

Just type or paste your value. The answer shows up right away — there is no button to press. Change anything and it updates by itself.

Do I need to install or sign up for anything?

Not at all — it runs in the browser with nothing to install and no account. After it loads once, it even works without an internet connection.

Is my information private?

Yes. Everything happens in your browser. Nothing you type is sent to a server or saved anywhere.

Common Use Cases

Learning non-standard positional systems

See exactly how a base with negative digits encodes signed numbers without a sign bit, with the arithmetic spelled out step by step.

The two-pan balance puzzle

Each balanced-ternary digit maps to placing a weight on the other pan (+1), the same pan as the object (−1), or setting it aside (0) — the classic 1, 3, 9, 27 weighing problem.

Setun & ternary computing

Explore the representation used by the Setun computer and modern ternary-logic experiments, where negation is just digit swapping.

Signed-digit arithmetic

Understand redundant and balanced signed-digit number systems used to speed up multiplication and carry-free addition.

Last updated: