Unitly
English

Number base converter

Enter a number and its base to see it in binary, octal, decimal and hex at once.

More tools

Go to the unit converter →

How base conversion works

To convert a decimal number to another base, keep dividing by the base and read the remainders backwards. For 13 in binary: 13 ÷ 2 = 6 remainder 1, 6 ÷ 2 = 3 remainder 0, 3 ÷ 2 = 1 remainder 1, 1 ÷ 2 = 0 remainder 1, giving 1101. Going back, 1101 is 1×8 + 1×4 + 0×2 + 1×1 = 13.

  • Hexadecimal uses 0 to 9 and A to F (10 to 15). Four binary digits map to one hex digit, which is why hex is used for colour codes (#FF8800) and memory addresses.
  • Octal groups binary digits in threes and shows up in Linux file permissions (755).
  • Numbers starting with 0x, 0b or 0o can be pasted as they are.

The tool works with whole numbers of any length and stays exact for very large values.

FAQ

What is 255 in binary?
11111111. In hex it is FF and in octal 377.
How are negative numbers shown?
With a minus sign, like -1010, together with the 8, 16, 32 or 64-bit two's complement value.