Number Base Converter Developer Tool

Convert numbers between binary, octal, decimal, and hexadecimal live.

Translating a value between binary, octal, decimal, and hexadecimal by hand is tedious and easy to get wrong once a number runs more than a few digits. This free number base converter is a developer tool that keeps binary, octal, decimal, and hexadecimal in sync as you edit any one of them, entirely in your browser.

Binary (base 2)
Octal (base 8)
Decimal (base 10)
Hexadecimal (base 16)

Runs entirely in your browser — no data is sent anywhere.

Why these four bases

Binary is the format a computer actually stores everything in — every one of these bases is just a different way of writing down the same underlying value. Octal shows up in legacy contexts like Unix file permissions (chmod 755). Decimal is how humans normally think in numbers day to day. Hexadecimal is the developer favourite for representing binary data compactly, because each hex digit maps cleanly onto exactly four bits — a byte is always exactly two hex digits, which is why colours, memory addresses, hashes, and UUIDs are conventionally written in hex rather than decimal.

Why hex maps so cleanly onto binary

Sixteen is a power of two (24), so every hex digit corresponds to exactly four binary digits with no remainder or carrying between groups — 0xF is always 1111, regardless of what surrounds it. Decimal has no such clean relationship to binary, since ten isn't a power of two, which is why converting decimal to binary requires actual arithmetic (repeated division by two) rather than a straightforward digit-by-digit substitution the way binary-to-hex does.

Handling large values

JavaScript's native numbers lose precision beyond 253, which matters for anything working with 64-bit values like large hashes or memory addresses. This tool uses JavaScript's BigInt type internally, so values well beyond that threshold still convert exactly rather than silently rounding.

Related tools

Hex shows up constantly outside pure number bases too — CSS colours are hexadecimal RGB triplets, which the colour converter handles directly with picker and format-specific tooling rather than this converter's raw base arithmetic. And hex is also the standard way to display the output of a hash generator, since a hash's raw bytes are conventionally rendered as a hex string for readability and safe copy-pasting.