← Back
Number System Converter
Binary, octal, decimal, hex
Conversions
—
Binary
—
Octal
—
Decimal
—
Hexadecimal
—
What is a Number Base Converter?
Converts numbers between binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16).
How It Works
Decimal to Binary: repeatedly divide by 2, collect remainders. Decimal to Hex: divide by 16, use 0-9 and A-F.
Example
Decimal 255 = Binary 11111111 = Hex FF = Octal 377. Decimal 42 = Binary 101010 = Hex 2A.
Pro Tips
- Hex colours in CSS: #FF5733 = R=255, G=87, B=51 in decimal RGB values.
- IP addresses: each octet is 0-255 (8 bits = 1 byte). 192.168.1.1 is four sets of 8 binary bits.
- Bitwise operations in code use binary; results often displayed in hex for compactness.
- Unicode code points are written in hex: A=U+0041.
FAQ
Binary to decimal?▼
Sum each bit x 2^position. 1010 = 1x8 + 0x4 + 1x2 + 0x1 = 10.
What is hexadecimal?▼
Base 16 using 0-9 and A-F. One hex digit = 4 binary bits. 0xFF = 255.
Why do computers use binary?▼
Transistors have 2 states (on/off = 1/0); binary maps naturally to this physical reality.
What is octal used for?▼
Unix file permissions (chmod 755 = rwxr-xr-x). Less common in modern programming.