Binary Converter

Enter a decimal value in the Decimal field and read the Binary line as soon as the number is valid. Whole numbers convert directly; fractional parts are dropped with truncation before the base-2 string is built.

Updated 2026-08-03 · math

Binary: 101010

About this tool

The converter watches a single Decimal input. When the value is a finite number, it truncates toward zero with Math.trunc, then calls toString(2) to produce a Binary line. Non-numeric input shows Enter a number so you know the field still needs a real value.

How to use

  1. Focus the Decimal field: Open the tool and click the Decimal input (sample default is 42).
  2. Type your number: Enter the decimal value you want shown in binary.
  3. Read the Binary line: When the input is valid, the result shows Binary: followed by the base-2 digits.
  4. Correct bad input: If you see Enter a number, replace letters or empty text with a finite numeric value.

Common use cases

Tips

FAQ

Is conversion live or button-based?

Live. The Binary line updates whenever the Decimal field changes.

What happens to decimals like 10.7?

The tool truncates toward zero first, so 10.7 converts as 10 → 1010.

Can I convert binary back to decimal here?

This page only maps decimal input to a binary string, not the reverse.

Why do I see Enter a number?

The field is empty or not a finite number, so no binary string is produced yet.

Related keywords

Related tools