Binary, Decimal and Hex Converter
Convert whole numbers between binary, octal, decimal, hexadecimal and any base from 2 to 36, with no size limit.
How to use it
- 01
Enter your number and choose the base it’s written in (decimal by default).
- 02
You’ll instantly see it in binary, octal, decimal and hexadecimal, plus any other base you choose.
- 03
Copy any result with its button. The grouping spaces are removed when you copy.
How it works
In a positional number system, each digit is worth its value times a power of the base. In binary, 1011 = 1×8 + 0×4 + 1×2 + 1×1 = 11. Hexadecimal uses the letters A through F for the values 10 to 15, so FF = 15×16 + 15 = 255.
Each hex digit maps to exactly four bits, and each octal digit to three. That’s why binary and hex results are grouped in fours: 1111 1111 = FF.
Bases above 10 use letters of the alphabet as digits, up to base 36 (0–9 and A–Z).
The math uses arbitrary-precision integers, so nothing gets rounded, even with hundreds of digits. Negative numbers are shown with a minus sign, not in two’s complement.
Examples
- One byte
Decimal 255 is 1111 1111 in binary, 377 in octal and FF in hex: the largest value a single byte can hold.
- Web colors
The color #1E7A45 has red, green and blue values of 1E = 30, 7A = 122 and 45 = 69.
- File permissions
Octal permission 755 is 111 101 101 in binary: read, write and execute for the owner, and read and execute for everyone else.
Frequently asked questions
Why is hexadecimal used in computing?
Because each hex digit stands for exactly four bits, a byte always takes two hex digits (00 to FF). It’s much shorter than binary and converts to it directly.
Can I convert numbers with a decimal point?
No, the converter only works with whole numbers. Fractions often repeat forever in binary (decimal 0.1 has no exact binary representation).