Binary Converter

Enter a number, say which base it is written in, and see it in binary, decimal, hexadecimal and octal together. Binary is grouped in blocks of four so it lines up with hexadecimal digits. Numbers of any length work, not just ones that fit in a normal calculator.

What you enter

What you get

How it works

  1. Type the number. You may include spaces, underscores or a prefix such as 0b, 0x or 0o; they are ignored.
  2. Choose the base the number is written in: binary (2), octal (8), decimal (10) or hexadecimal (16).
  3. Read the four results and the number of bits needed. Binary is split into groups of four for readability.
  4. If you see an error, check that every digit is allowed in your base, for example only 0 and 1 in binary.

Why computers use binary and what the other bases are for

A computer stores everything as switches that are either off or on, which maps naturally onto the two digits of binary. Eight of those switches make a byte, which can hold 256 different values from 0 to 255. Binary is exact and simple for machines but long and error-prone for people, so shorter notations were adopted for humans.

Hexadecimal packs four bits into one character, so a byte is always two hex digits. That is why colours (#FF8800), memory addresses and checksums are written in hex. Octal packs three bits per digit and survives mainly in Unix file permissions, where 755 means three groups of read, write and execute flags.

How the conversion is done

The tool reads your digits in the base you chose, building up the value one digit at a time (multiply by the base, add the next digit), then writes the same value out in the other bases. Using whole-number arithmetic of unlimited size means a 64-bit or 128-bit value is converted without rounding.

Watch for digits that do not belong to the base. The letter A is valid in hexadecimal, but 2 is not valid in binary and 8 is not valid in octal. The tool rejects those instead of guessing.

Fractions, such as 0.1 in binary, are not covered here, and floating-point storage is a separate topic. This converter handles whole numbers, which is what most programming and networking tasks need.

Tips

Frequently asked questions

How do I convert binary to decimal?

Give each digit a place value that doubles from the right (1, 2, 4, 8, 16 and so on) and add the places that hold a 1. For example, 1101 = 8 + 4 + 0 + 1 = 13.

How do I convert decimal to binary?

Divide the number by 2 repeatedly and write down the remainders from last to first. For 13: 13 / 2 = 6 r 1, 6 / 2 = 3 r 0, 3 / 2 = 1 r 1, 1 / 2 = 0 r 1. Reading upward gives 1101.

How do I convert binary to hexadecimal?

Split the binary number into groups of four from the right and replace each group with a hex digit. 1111 1111 becomes FF, which is 255.

Can it handle negative numbers?

Yes, a leading minus sign is kept and the result is shown as a signed value, for example -5 is -101 in binary. It does not show two's complement, which depends on a chosen bit width.

Is there a size limit?

Input is limited to 1,000 digits, which is far beyond any register. Results are exact because the tool uses arbitrary-size integers.

Related: Hex converter, Hex colour picker, Profit margin calculator.

Start for free or see all free tools. We.Inc is free to start, with no card needed. AI building is on paid plans from $20 a month.

More in Free Tools

We.Inc is an AI-powered website builder you can resell under your own brand. Launch a branded client dashboard, bill on Stripe Connect, and deliver AI-generated websites in minutes. White-label plans start at $99 a month for 25 client sites, with a 7-day free trial and no per-site fees.

Product

Who It's For

Features

Resources

Company

View Sitemap