Binary Converter

Convert between Binary, Decimal, Hexadecimal, and Octal

Number System Converter

Binary Visualization (8-bit)

02⁷
02⁶
02⁵
02⁴
0
0
0
02⁰
128
64
32
16
8
4
2
1

Click on bits to toggle them!

Understanding Binary

What is Binary?

Binary is a base-2 number system using only two digits:

  • 0 - OFF / False / No
  • 1 - ON / True / Yes

Computers use binary because electronic circuits can easily represent two states (on/off).

Why Computers Use Binary

  • Transistors have two states (on/off)
  • Easy to store and transmit
  • Less prone to errors
  • Simple circuit design

Place Values in Binary

Each position represents a power of 2 (right to left):

Position 76543210
Power of 2 2⁷2⁶2⁵2⁴2⁰
Value 1286432168421

Example: Binary 10110 to Decimal

1 × 16 = 16

0 × 8 = 0

1 × 4 = 4

1 × 2 = 2

0 × 1 = 0

Total: 16 + 4 + 2 = 22

Common Binary Values

0=0000
1=0001
5=0101
10=1010
15=1111
255=11111111

Data Units

  • Bit: Single 0 or 1
  • Nibble: 4 bits
  • Byte: 8 bits (0-255)
  • Kilobyte: 1,024 bytes
  • Megabyte: 1,024 KB
  • Gigabyte: 1,024 MB

Hexadecimal & Octal

🔷

Hexadecimal (Base 16)

Uses 16 symbols: 0-9 and A-F

0 1 2 3 4 5 6 7 8 9 A B C D E F

A=10, B=11, C=12, D=13, E=14, F=15

🔶

Octal (Base 8)

Uses 8 symbols: 0-7

0 1 2 3 4 5 6 7

No 8 or 9 in octal!

Why Use Hexadecimal?

  • Shorter: 1 hex digit = 4 binary digits (e.g., F = 1111)
  • Memory addresses: RAM addresses shown in hex
  • Colors: Web colors use hex (#FF5733)
  • MAC addresses: Network card IDs in hex

Hex to Binary Conversion

Each hex digit converts to exactly 4 binary digits:

Hex 01234567
Binary 00000001001000110100010101100111
Hex 89ABCDEF
Binary 10001001101010111100110111101111

Real World Examples

  • Web Colors: #FF0000 = Red, #00FF00 = Green, #0000FF = Blue
  • MAC Address: 00:1A:2B:3C:4D:5E
  • Memory: Address 0x7FFE (32,766 in decimal)
  • Error codes: 0x80070005 (Windows error)

Step-by-Step Conversions

Try a Conversion

Decimal to Binary (Division Method)

  1. Divide the number by 2
  2. Write down the remainder (0 or 1)
  3. Divide the quotient by 2
  4. Repeat until quotient is 0
  5. Read remainders from bottom to top

Example: Convert 25 to Binary

25 ÷ 2 = 12 remainder 1

12 ÷ 2 = 6 remainder 0

6 ÷ 2 = 3 remainder 0

3 ÷ 2 = 1 remainder 1

1 ÷ 2 = 0 remainder 1

Read bottom to top: 11001

Binary to Decimal (Multiplication Method)

  1. Write the place values (powers of 2) above each digit
  2. Multiply each digit by its place value
  3. Add all the products together

Binary Quiz

0
Score
0
Questions
0
Streak
Click "Start Quiz" to begin!