Number system converter: binary, decimal, octal and hexadecimal

Number System Converter


Convert

Binary, hex and friends: converting between number bases by hand

Computers store everything as binary (1s and 0s), humans read decimal, and programmers reach for hexadecimal because it packs four binary digits into one symbol. This tool converts a number between decimal (base 10), binary (base 2), octal (base 8) and hexadecimal (base 16) as you type — in either direction. Below is how the bases work and how to do the same conversions by hand when you don't have the tool.

Converting by hand: the place-value method

Every base works the same way: each digit has a place value equal to a power of the base. Take 42 in decimal — the 4 is in the "tens" place (101) and the 2 in the "ones" place (100).

Decimal to binary: divide repeatedly by 2, keeping the remainders. 42 ÷ 2 = 21 r0, 21 ÷ 2 = 10 r1, 10 ÷ 2 = 5 r0, 5 ÷ 2 = 2 r1, 2 ÷ 2 = 1 r0, 1 ÷ 2 = 0 r1. Reading the remainders bottom-up gives 101010 (32 + 8 + 2 = 42). That's exactly what the tool returns for "42 to binary".

Hex to decimal: multiply each digit by 16position. The hex value 2F is (2 × 16) + (F = 15) = 47. Octal works the same way with powers of 8 — octal 377 is (3 × 64) + (7 × 8) + 7 = 255.

The four systems at a glance

Quick reference matrix

Decimal (base 10) Binary (base 2) Octal (base 8) Hexadecimal (base 16)
0000000
5010155
10101012A
15111117F
16100002010
25511111111377FF

The last row is the useful one: 255 is the largest value in one byte, and in hex it is a tidy FF — which is why computer-colour and byte values so often end in "FF".

Where you actually meet these bases

Base-conversion questions that keep coming up

Why do programmers use hex instead of writing binary directly?

Because one hex digit equals exactly four bits, so a long binary string like "1111 1111 1111 1111" becomes "FFFF". It's more compact and much harder to misread — the same information in a fraction of the characters.

How do I read letters in a hex input?

In hexadecimal, A = 10, B = 11, C = 12, D = 13, E = 14 and F = 15. The tool accepts both upper and lowercase letters when converting to or from base 16.

Why is octal still around if binary and hex exist?

Mostly legacy — early computers used word sizes divisible by 3 bits. It survives today mainly in Unix file permissions, where each digit encodes three rwx bits (7 = rwx, 5 = r-x, and so on).

Can the tool convert fractional or negative numbers?

No — like most base converters, it handles non-negative integers. Fractions between bases need a different representation (binary points, floating point) and are out of scope for a quick conversion tool.