Home › Binary, Decimal & Hex Converter
Binary, Decimal & Hex Converter
Convert numbers between binary, octal, decimal and hexadecimal instantly, with the 8-bit, 16-bit and 32-bit binary forms.
How to use it
- Type the number. For hexadecimal use digits 0-9 and A-F (no 0x needed, though it is accepted).
- Choose the base the number is written in.
- Read the value in all four bases at once and copy the one you need.
How it works
Computers store numbers in binary (base 2); programmers use hexadecimal (base 16) because each hex digit is exactly four bits, and octal (base 8) for Unix file permissions. To convert by hand, decimal → binary: divide by 2 repeatedly and read the remainders backwards; binary → decimal: add the powers of two where there is a 1.
Examples: 255 decimal = 11111111 binary = FF hex = 377 octal; 1010 binary = 10 decimal = A hex. This converter handles integers up to 2^53 exactly and accepts negative numbers.
FAQ
How do I convert binary to decimal?
Write the powers of two under each bit from the right (1, 2, 4, 8, ...) and add those where the bit is 1: 1011 = 8 + 2 + 1 = 11.
What is 255 in binary and hex?
255 = 11111111 in binary (8 ones) and FF in hexadecimal; it is the largest value of an unsigned byte.
Why do programmers use hexadecimal?
Each hex digit equals four binary digits, so a byte is two hex digits - much shorter and easier to read than 8 binary digits.
Related calculators
Free calculator by NumSpell