Skip to content
ToutUtils

Conversions

Number base converter

Type a whole number in binary, octal, decimal or hexadecimal and the other three fields fill in with the same value.

How to use this tool

The four fields show the same number in base 2, 8, 10 and 16. Type in any of them and the three others update. Each field accepts only its own digits: 0 and 1 for binary, 0 to 7 for octal, 0 to 9 for decimal, 0 to 9 and A to F for hexadecimal, in capitals or lowercase. Anything else, including spaces, a 0x prefix or a decimal point, is reported as invalid. The principle is positional notation: each digit is multiplied by a power of the base, so 1010 in binary is 8 + 2 = 10. A minus sign is accepted in the decimal field only and is carried over as a plain sign (-10 gives -1010), without two's complement. Values are exact up to 9,007,199,254,740,991, which is 2 to the power 53 minus 1; larger numbers lose their last digits.

Concrete examples

  • 255 (decimal) → 11111111 (binary), 377 (octal), FF (hexadecimal)
  • 755 (octal) → 111101101 (binary), 493 (decimal), 1ED (hexadecimal)
  • A0 (hexadecimal) → 160 (decimal), 10100000 (binary), 240 (octal)
  • 1010 (binary) → 10 (decimal), 12 (octal), A (hexadecimal)
  • FF5733 (hexadecimal) → 16734003 (decimal)

Frequently asked questions

How do I convert binary to decimal by hand?
Give each digit a weight, starting from the right: 1, 2, 4, 8, 16 and so on, then add the weights where the digit is 1. For 101101: 32 + 8 + 4 + 1 = 45. In the other direction, divide the decimal number by 2 repeatedly and read the remainders from last to first.
Why does hexadecimal use letters?
Base 16 needs sixteen digits and 0 to 9 only provide ten, so A to F stand for 10 to 15. One hexadecimal digit covers exactly four bits, which makes a byte two digits long: 11111111 is FF. That is why colors, memory addresses and hashes are written in hexadecimal.
What is octal still used for?
Mostly Unix file permissions. Each octal digit packs three bits, one each for read, write and execute: 7 is 111 (all three), 5 is 101 (read and execute), 4 is 100 (read only). chmod 755 therefore means rwx for the owner and r-x for the group and for others.
Can I convert negative or fractional numbers?
Negative numbers only from the decimal field: the result keeps a minus sign in front, so -10 gives -1010 in binary. The tool does not compute two's complement, the form processors use for negative integers. Fractions such as 0.5 are not supported in any base.

Related tools