Binary, Hex & Decimal Converter
Convert a number between binary, octal, decimal, hex, or any base up to 36.
How base conversion works
Every position in a number is a power of the base. Binary 11010110 is 128+64+16+4+2 = 214 in decimal, which is D6 in hex. Converting out of decimal goes the other way: repeatedly divide by the target base and read the remainders backwards.
Why hex and binary get along
16 is 2⁴, so each hex digit is exactly four binary digits: D6 is 1101 0110. That's why programmers write bytes as two hex characters, and why octal (three bits per digit) shows up in Unix permissions.