Number Base Converter

Convert between binary, octal, decimal and hex.

About this tool

Type a number in binary, octal, decimal or hexadecimal and see it in all the others, along with its bits grouped into bytes. Handles arbitrarily large integers and recognises 0x, 0b and 0o prefixes.

How to use it

  1. Type a number into any of the four fields: binary, octal, decimal or hexadecimal.
  2. The other fields update instantly. Prefixes like 0x, 0b and 0o are accepted.
  3. Check the bits panel to see the value split into bytes.

Questions

How big a number can it handle?
Any size. It uses JavaScript BigInt, so there is no 32-bit or 64-bit limit and no rounding.
Why do hex numbers start with 0x?
It is a convention from C, now used by most languages, to show that the digits are hexadecimal. Similarly 0b marks binary and 0o marks octal.
Where is octal still used?
Mainly for Unix file permissions, where 755 means rwxr-xr-x. Each octal digit maps neatly onto three permission bits.

Something not working, or a result looks wrong? Report a problem with this tool