Ternary to Binary Converter

Converts a ternary string to binary by parsing it as a BigInt (accumulating value × 3 + digit for each digit) and rendering the result in base 2, the exact inverse of Binary to Ternary Converter. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-07-27

Overview

Introduction

Ternary (base 3) numbers occasionally show up in balanced-ternary computing history, puzzles, and numeral-system teaching, and converting them back to the far more common binary representation is a natural companion operation.

This tool parses a ternary string and produces its exact binary equivalent using arbitrary-precision BigInt arithmetic.

What Is Ternary to Binary Converter?

A base-conversion utility that reads a string of ternary digits (0, 1, 2) and outputs the equivalent value written in binary (base 2).

It is the direct inverse of the Binary to Ternary Converter in this same category.

How Ternary to Binary Converter Works

The input is trimmed and validated to ensure it contains only the digits 0, 1, and 2.

Each digit is folded into a running BigInt total using the standard positional-accumulation formula (value = value × 3 + digit), processing digits from most significant to least significant. The final BigInt is then rendered as a binary string.

When To Use Ternary to Binary Converter

Use it whenever you have a ternary value — from a puzzle, a balanced-ternary computing reference, or a homework problem — and need its binary equivalent.

It also serves as a quick way to verify a manual base-3-to-base-2 conversion.

Features

Advantages

  • Exact BigInt arithmetic avoids precision loss for long ternary inputs.
  • Simple, direct validation gives clear feedback on invalid (non-ternary) input.
  • Instant, fully client-side conversion.

Limitations

  • Only accepts standard (unbalanced) ternary digits 0, 1, 2 — balanced ternary (which uses -1, 0, 1) is not supported.
  • Leading zeros in the input are accepted but don't affect the numeric result, since they carry no positional value.

Examples

Converting ternary 101

Input

101

Output

1010

Ternary 101 is decimal 10 (1×9 + 0×3 + 1×1 = 10), and decimal 10 in binary is 1010.

Converting ternary 100110

Input

100110

Output

11111111

Ternary 100110 is decimal 255 (1×243 + 0×81 + 0×27 + 1×9 + 1×3 + 0×1 = 255), which is 11111111 in binary.

Best Practices & Notes

Best Practices

  • Double check your ternary source only uses digits 0-2; a stray 3 or higher is a common transcription mistake.
  • Round-trip your result through the Binary to Ternary Converter to confirm the conversion.

Developer Notes

Implemented with a manual BigInt accumulation loop (value = value * BigInt(3) + BigInt(digit) per character) rather than Number/parseInt, so long ternary strings convert correctly even once their value exceeds Number.MAX_SAFE_INTEGER.

Ternary to Binary Converter Use Cases

  • Converting balanced or unbalanced ternary puzzle values back to familiar binary
  • Checking base-3-to-base-2 conversion logic in coursework or custom code
  • Exploring how the same quantity looks across different positional numeral systems

Common Mistakes

  • Entering a digit like 3 or higher, which isn't valid in base 3 and will be rejected.
  • Confusing standard ternary with balanced ternary, which uses a different digit set (-1, 0, 1) and isn't handled by this tool.

Tips

  • Use the Binary to Ternary Converter to go the other direction.
  • For a source base other than 3, the Binary to Any Base Converter accepts binary output for bases 2 through 36 but not arbitrary-base input — for other input bases, convert to decimal first.

References

Frequently Asked Questions