Number Base Converter
Convert numbers between binary, octal, decimal and hexadecimal.
Frequently asked questions
Which number bases are supported?
Binary (base 2), octal (base 8), decimal (base 10) and hexadecimal (base 16). Enter a value in any base and see it in all the others.
Why convert between bases?
Programmers use hex and binary constantly — for colours, bit flags, memory addresses and network masks. Converting by hand is error-prone; this does it instantly.
What is the largest number it handles?
It works with standard 64-bit integers. Extremely large values beyond that range are not supported.
Why do programmers use hexadecimal?
Hexadecimal maps neatly to binary because each hex digit represents exactly four bits, making it a compact, readable way to write binary values such as colors, memory addresses and bit masks.
How do I convert binary to decimal by hand?
Add the place values of each 1 bit, where positions from the right represent 1, 2, 4, 8 and so on. For example binary 1011 is 8 plus 2 plus 1, which equals 11 in decimal.
What is two's complement?
Two's complement is the standard way computers represent signed integers, where the most significant bit indicates the sign and negatives are stored by inverting the bits and adding one. It lets addition work uniformly for positive and negative numbers.
What does the 0x or 0b prefix mean?
The 0x prefix marks a hexadecimal number and the 0b prefix marks a binary number in many programming languages, distinguishing them from ordinary decimal values.