Binary, Hex & Octal Converter

Convert a number between binary, decimal, octal and hexadecimal. Type into any of the four boxes and the other three follow.

The number in four bases

Only 0 and 1. Negative numbers are shown as signed two's complement.
Digits 0 to 7.
Digits 0-9 and letters A-F. Lower case is fine, output uses A-F.
The conversion is shown live as you type. Nothing leaves this browser.

Character count

0 Binary digits
0 Hex digits

Private by design. No backend — the conversion happens in JavaScript on your own device.

How base conversion works

What a base is

A base is how many different digits a number system allows. Decimal has ten digits (0-9), binary two (0-1), octal eight (0-7) and hex sixteen (0-9 and A-F, where A=10 ... F=15). Each position in a number is worth that many times more than the position to its right: in base 2, 1011 is 8 + 0 + 2 + 1 = 11.

Negative numbers

In binary, negative numbers are shown in two's complement, the way a CPU stores them. A 16-bit signed range — from -32768 to 32767 — is used, so -1 shows as sixteen ones. Other bases show an ordinary minus sign.

What each box accepts

Only the digits its base allows. Type something out of range and that box is flagged rather than silently ignored, so a stray letter can't quietly change the answer. Leading zeros are trimmed from the result.

Common uses

Reading binary from a datasheet, pasting hex colour or memory addresses, setting an octal file permission, or checking your own arithmetic on a CS assignment.

How to use the Binary, Hex & Octal Converter

  1. Type a value into any of the four fields — binary, octal, decimal or hexadecimal.
  2. The other three update as you type.
  3. Copy the base you need.

Frequently asked questions

Can I enter a negative or fractional number?

It is intended for whole numbers in the four common bases; negatives and fractions are not standard here.

Does hex need a 0x prefix?

No. Type the digits directly and the value is treated as hexadecimal.

Which bases are supported?

Binary (base 2), octal (base 8), decimal (base 10) and hexadecimal (base 16).