Binary / Hex / Decimal Converter

Type a number into any box and the other three update instantly. Prefixes such as 0x and 0b are accepted, and spaces or underscores between digits are ignored.

About this Number Base Converter

This converter moves a whole number between the four bases used most often in computing: binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16). There is no button to press — edit any box and the other three are rewritten as you type. Underneath, the tool reports how many bits and bytes the value needs, which is handy when you are checking whether a number fits in 8, 16, or 32 bits.

Input is forgiving. You can paste 0xFF, 0b1010, or 0o755 and the prefix is recognised and stripped, and digit separators such as spaces, underscores, and commas are ignored so 1010 1100 works as well as 10101100. Hex letters can be typed in either case. If a digit is not valid for the box you are typing in — a 2 in the binary field, or a 9 in octal — the tool says so instead of guessing what you meant.

Conversions use arbitrary-precision arithmetic, so very long values stay exact. This matters because ordinary JavaScript numbers lose precision beyond about 9 quadrillion, which would silently corrupt a 64-bit hex value such as a hash fragment or an identifier. Here a 256-bit binary string converts to decimal and back without drifting. Negative values are supported with a leading minus sign, written as sign-and-magnitude rather than as a two's complement bit pattern.

Students use base conversion for computer science coursework and digital logic exercises, while developers use it when reading memory addresses, colour values, file permissions, bitmasks, and network data. Hexadecimal is popular because one hex digit maps neatly onto exactly four binary digits, so long binary strings become short and readable — and because everything here runs in your browser, nothing you convert is uploaded.

← Back to all tools