Binary Converter: Convert Between Binary, Decimal, Octal and Hex

Type any number, say which base it is written in, and get all four representations at once, plus the bit length and the signed versus unsigned reading of the decimal value.

Digits that do not belong to the chosen base are rejected, for example, 2 is not a valid binary digit. Spaces and underscores are ignored; 0x, 0b and 0o prefixes are accepted.

How Binary Works

A binary converter turns a number from one base into another. Enter a value in binary, decimal, octal or hexadecimal and see it in all four at once.

Binary uses only two digits, 0 and 1. Each digit is called a bit. Computers use it because a circuit is easily either off (0) or on (1). Everyday decimal uses ten digits, but the idea is identical: the position of a digit decides how much it is worth.

3D infographic: binary digits 10110100 converting into decimal 180, octal 264 and hexadecimal B4 on floating cards
One input, four outputs: enter a value in any base and see it in binary, decimal, octal and hex.

Converting With Positional Weights

In binary, each position is worth a power of 2, starting from 1 on the right: 1, 2, 4, 8, 16, and so on. To convert to decimal, add up the weights wherever there is a 1.

Worked example: 1011 binary to decimal

8 + 0 + 2 + 1 = 11. So 1011 in binary is 11 in decimal.

To go the other way, divide the decimal number by 2 repeatedly and note each remainder. Read the remainders from last to first. For 11: 11 ÷ 2 = 5 remainder 1, 5 ÷ 2 = 2 remainder 1, 2 ÷ 2 = 1 remainder 0, 1 ÷ 2 = 0 remainder 1, reading backwards gives 1011.

For checking the arithmetic along the way, a scientific calculator handles powers of 2 quickly.

Place-value diagram of binary 10110100: each bit sits above its place value 128, 64, 32, 16, 8, 4, 2, 1, and the set bits 128 + 32 + 16 + 4 add to 180
Each binary digit sits above a power of two; the set bits add up to the decimal value.

The Four Bases Compared

Hex is popular because one hex digit equals exactly four bits, which makes long binary strings much shorter to read.

Common Conversions

Bit Length, Signed and Unsigned

Bit length is how many bits a number is stored in. An 8-bit value has 256 possible combinations, so unsigned (no negatives) it covers 0 to 255. Signed numbers reserve the leftmost bit to show positive or negative, usually using a method called two's complement. An 8-bit signed value then covers -128 to 127. The same bits can mean different numbers depending on which type is used, so always know which one you are working with.

If you also work with ratios while handling data sizes, the percentage calculator can help.

Reference chart of the four number systems: binary digits 0-1, octal 0-7, decimal 0-9, hexadecimal 0-9 and A-F, with the example 11111111 = 377 = 255 = FF
The four bases side by side, one value, four notations, including the classic 11111111 = 255 = FF.

Frequently asked questions

What is 1010 in binary as a decimal?

It is 10. The weights are 8 + 0 + 2 + 0.

Why do computers use binary?

Hardware reliably distinguishes two states, on and off, so binary is the simplest dependable way to store and process data.

Why does hexadecimal use letters?

Base 16 needs sixteen symbols. After 0-9, the letters A-F stand for 10 through 15.

Can binary represent negative numbers?

Yes. Signed formats such as two's complement use the leftmost bit to mark the sign.

How many values can 8 bits hold?

256, since 2 to the power of 8 is 256.

Start Calculating Now!

Discover the power of smart tools at KitQuarter.

Explore All Tools