Balanced Ternary Converter
Convert whole numbers to and from balanced ternary, the base-3 system whose digits are −1, 0 and +1. Negative numbers need no sign, and the working shows each division by 3.
How to Use
- Choose decimal to balanced ternary or the reverse.
- Type a whole number, positive or negative, or a balanced ternary string such as 1TT0.
- Choose how to write −1: as T, or with + and − signs.
- Read the balanced ternary, the decimal value, its negation and the number of trits.
- The drawing shows each digit with its power of 3, added or subtracted.
Worked Example
42 to balanced ternary. 42 ÷ 3 = 14 r 0 → 0. 14 ÷ 3 = 4 r 2: a remainder of 2 becomes T (−1), and the quotient goes up by 1 to 5. 5 ÷ 3 = 1 r 2 → T, quotient 2. 2 ÷ 3 = 0 r 2 → T, quotient 1. 1 → 1. Reading upwards: 1TTT0. Check: 81 − 27 − 9 − 3 + 0 = 42.
Reading 11T01. The places are 81, 27, 9, 3 and 1: 81 + 27 − 9 + 0 + 1 = 100.
The common mistake: keeping the digit 2. Ordinary ternary writes 42 as 1120, using the digit 2. Balanced ternary has no 2: every remainder of 2 must become −1 with a carry of 1, otherwise the result is just ordinary base 3.
Show Work
Formulas
Weights, Puzzles and Setun
Balanced ternary first appeared as a puzzle: with weights of 1, 3, 9 and 27 and a two-pan balance, you can weigh any whole load from 1 to 40, putting each weight in the same pan as the load (−1), leaving it out (0) or putting it in the other pan (+1). Fibonacci posed a version of it in 1202, and Léon Lalanne proposed a balanced ternary calculating machine in 1840.
The Setun computer, built at Moscow State University in 1958, used balanced ternary throughout, storing trits in pairs of magnetic cores. Its designers liked that rounding is just truncation and that negative numbers need no special handling. Binary won because two-state electronics are simpler and more reliable, but balanced ternary still turns up in algorithms, signed-digit arithmetic and puzzles.
About This Calculator
This converter turns whole numbers of any size, positive or negative, into balanced ternary and back, writing −1 as T or with + and − signs. It shows the division steps, the place values added and subtracted, the negation, the ordinary base-3 form and the number of trits.
Everything runs in your browser; nothing is sent anywhere. For the other famous signed base, base −2, use the negabinary converter.
Related calculators: Negabinary Converter, Number Base Converter, and Signed Number Representations.
Frequently Asked Questions
What is balanced ternary?
A base-3 number system whose digits are −1, 0 and +1 instead of 0, 1 and 2. The −1 digit is usually written T (or 1 with a bar, or −). Every integer, positive or negative, has exactly one representation, so no separate minus sign is needed: 42 is 1TTT0, which is 81 − 27 − 9 − 3.
How do you convert a number to balanced ternary?
Divide by 3 repeatedly. A remainder of 0 or 1 is that digit; a remainder of 2 becomes the digit −1 (T), and you add 1 to the quotient to make up for it. 5 ÷ 3 = 1 r 2 → T, carry: 2 ÷ 3 = 0 r 2 → T, carry: 1 → 1. Reading upwards, 5 = 1TT, which is 9 − 3 − 1.
How do you negate a balanced ternary number?
Swap every 1 for T and every T for 1. 5 = 1TT, so −5 = T11 (−9 + 3 + 1). That is why balanced ternary needs no separate sign and no two’s complement trick.
Why is balanced ternary interesting?
Rounding is the same as truncating: dropping the last trits always gives the nearest value. Base 3 is also the most economical integer base by one measure (radix economy), and Donald Knuth called balanced ternary “perhaps the prettiest number system of all”.
Was there ever a ternary computer?
Yes. Setun, built at Moscow State University in 1958 under Nikolay Brusentsov, used balanced ternary; about 50 were made. It was followed by Setun-70, but binary electronics, which are simpler to build reliably, won.
How do I use the Balanced Ternary Converter?
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
Coursework
42 = 1TTT0 and 100 = 11T01, with each division by 3 shown.
Negation
5 = 1TT and −5 = T11: just swap the digits.
Weighing puzzles
Weights of 1, 3, 9 and 27 can balance any load up to 40: 25 = 10T1 means 27 + 1 against 3.
History of computing
Read values the way the 1958 Setun computer stored them.
Last updated: