About this tool
This number base converter (binary to decimal, decimal to hex, hex to binary, octal converter) shows a whole number in base 2, 8, 10 and 16 at the same time.
Choose the base you are typing in, enter the number, and the other three appear instantly with a copy button each. How do I convert binary to decimal? Each binary digit is a power of two, counted from the right.
For example 1111 1111 is 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255, which is FF in hexadecimal and 377 in octal. How do I convert decimal to binary or hex?
Divide by 2 (or 16) again and again and read the remainders from the bottom up. Hexadecimal uses the digits 0 to 9 and the letters A to F, where A is 10 and F is 15, so one hex digit equals exactly four binary digits.
That is why programmers use hex for colors, memory addresses and byte values. Octal groups three bits per digit and still appears in file permissions.
This tool uses big-number arithmetic, so very long values stay exact instead of being rounded. A leading minus sign is allowed, and spaces, commas, underscores and the prefixes 0b, 0o and 0x are ignored.
Binary results are grouped in fours and hex in pairs to make them easy to read, while the copy button gives you the plain digits.
Only whole numbers are supported, so fractions such as 0.5 are not converted, and negative values are shown with a minus sign rather than in two's complement.
For hex color codes try the color code converter, and for other measurements use the unit converter. Everything is calculated in your browser, and nothing you type is uploaded or saved.
How to use
- Choose the base your number is written in (2, 8, 10 or 16).
- Type or paste the number.
- Read the other three bases shown below.
- Press Copy next to the one you need.