Binary & Hex Converter
๐ข All Bases - Live Converter
Type in any field - all others update instantly.
Decimal
Base 10
Binary
Base 2
Hexadecimal
Base 16
Octal
Base 8
Quick Values
๏ธ Bitwise Operations
Enter two decimal numbers and select an operation.
A (Binary)-
B (Binary)-
AND Result-
Result (Binary)-
Result (Hex)-
Operation Reference
AND
1 only if both bits are 1.
Uses: masking, clearing bits
Uses: masking, clearing bits
OR
1 if either bit is 1.
Uses: setting bits
Uses: setting bits
XOR
1 if bits are different.
Uses: toggling, encryption
Uses: toggling, encryption
NOT
Flips all bits (01, 10).
Uses: complementing
Uses: complementing
Left Shift (<<)
Shifts bits left, multiplies by 2.
Uses: fast multiplication
Uses: fast multiplication
Right Shift (>>)
Shifts bits right, divides by 2.
Uses: fast division
Uses: fast division
๐ค Text ASCII Converter
Decimal / Binary / Hex / Octal Reference
Common values across all 4 number systems.
| Decimal | Binary | Hex | Octal | Notes |
|---|
How Number Systems Work
Positional Number Systems
Every number system uses positional notation - each digit's value depends on its position (place value).
Decimal (Base 10): digits 0โ9
Binary (Base 2): digits 0โ1
Octal (Base 8): digits 0โ7
Hex (Base 16): digits 0โ9, AโF
Value = ฮฃ (digit ร base^position)
Example: Decimal 255
= 2ร10ยฒ + 5ร10ยน + 5ร10โฐ
= 200 + 50 + 5 = 255
Binary (Base 2): digits 0โ1
Octal (Base 8): digits 0โ7
Hex (Base 16): digits 0โ9, AโF
Value = ฮฃ (digit ร base^position)
Example: Decimal 255
= 2ร10ยฒ + 5ร10ยน + 5ร10โฐ
= 200 + 50 + 5 = 255
Decimal Binary
Repeatedly divide by 2 and record remainders (read bottom to top).
Convert 13 to Binary:
13 รท 2 = 6 remainder 1 โ
6 รท 2 = 3 remainder 0 โ
3 รท 2 = 1 remainder 1 โ
1 รท 2 = 0 remainder 1 โ
Result: 1101 (read upward)
13 รท 2 = 6 remainder 1 โ
6 รท 2 = 3 remainder 0 โ
3 รท 2 = 1 remainder 1 โ
1 รท 2 = 0 remainder 1 โ
Result: 1101 (read upward)
Binary Decimal
Multiply each bit by its power of 2 and sum them.
Convert 1101 to Decimal:
1ร2ยณ + 1ร2ยฒ + 0ร2ยน + 1ร2โฐ
= 8 + 4 + 0 + 1
= 13
1ร2ยณ + 1ร2ยฒ + 0ร2ยน + 1ร2โฐ
= 8 + 4 + 0 + 1
= 13
Decimal Hexadecimal
Divide by 16, record remainders using 0โ9 and AโF.
Convert 255 to Hex:
255 รท 16 = 15 remainder 15 F โ
15 รท 16 = 0 remainder 15 F โ
Result: FF
255 รท 16 = 15 remainder 15 F โ
15 รท 16 = 0 remainder 15 F โ
Result: FF
Hex Binary (Shortcut)
Each hex digit = exactly 4 binary bits. Convert each digit independently.
Convert 1A3F to Binary:
1 0001
A 1010
3 0011
F 1111
Result: 0001 1010 0011 1111
1 0001
A 1010
3 0011
F 1111
Result: 0001 1010 0011 1111
Why Programmers Love Hex
1 byte = 8 bits = exactly 2 hex digits
FF hex = 1111 1111 binary = 255 decimal
Colors in web: #FF5733
= R:FF(255) G:57(87) B:33(51)
Memory addresses: 0x7FFF0000
IPv6 addresses: 2001:0db8:85a3::8a2e
FF hex = 1111 1111 binary = 255 decimal
Colors in web: #FF5733
= R:FF(255) G:57(87) B:33(51)
Memory addresses: 0x7FFF0000
IPv6 addresses: 2001:0db8:85a3::8a2e