Binary Converter
Convert numbers between binary, decimal, hexadecimal, and octal number systems
Number System Converter
Range: -128 to 127
Only 0s and 1s allowed (spaces for formatting)
Use digits 0-9 and letters A-F
Only digits 0-7 allowed
Common Binary Conversions
Decimal | Binary | Hex | Octal |
---|---|---|---|
0 | 0000 0000 | 0 | 0 |
1 | 0000 0001 | 1 | 1 |
2 | 0000 0010 | 2 | 2 |
4 | 0000 0100 | 4 | 4 |
8 | 0000 1000 | 8 | 10 |
16 | 0001 0000 | 10 | 20 |
32 | 0010 0000 | 20 | 40 |
64 | 0100 0000 | 40 | 100 |
128 | 1000 0000 | 80 | 200 |
255 | 1111 1111 | FF | 377 |
Number Systems
Binary (Base 2)
Uses digits: 0, 1
Each position represents a power of 2
Decimal (Base 10)
Uses digits: 0-9
Standard numbering system
Hexadecimal (Base 16)
Uses digits: 0-9, A-F
Common in computer programming
Octal (Base 8)
Uses digits: 0-7
Used in some computer systems
Conversion Tips
Each binary digit represents a power of 2
Hexadecimal is base 16: A=10, B=11, C=12, D=13, E=14, F=15
Binary groupings of 4 bits equal 1 hex digit
Two's complement is used for negative binary numbers
Understanding Binary and Number Systems
What is the Binary System?
The binary system is a base-2 number system that uses only two digits: 0 and 1. Each position in a binary number represents a power of 2, starting from 2⁰ = 1 on the right.
Binary Example: 1101
- 1 × 2³ = 1 × 8 = 8
- 1 × 2² = 1 × 4 = 4
- 0 × 2¹ = 0 × 2 = 0
- 1 × 2⁰ = 1 × 1 = 1
- Total: 8 + 4 + 0 + 1 = 13
Converting Decimal to Binary
To convert a decimal number to binary, repeatedly divide by 2 and track the remainders:
Example: Convert 19 to Binary
- 19 ÷ 2 = 9 remainder 1
- 9 ÷ 2 = 4 remainder 1
- 4 ÷ 2 = 2 remainder 0
- 2 ÷ 2 = 1 remainder 0
- 1 ÷ 2 = 0 remainder 1
- Result: 10011 (read remainders bottom to top)
Negative Numbers (Two's Complement)
To represent negative numbers in binary, we use two's complement:
- 1. Start with the positive binary representation
- 2. Invert all bits (one's complement)
- 3. Add 1 to get two's complement
Applications
- •Computer programming and data representation
- •Digital electronics and circuit design
- •Network addressing and subnetting
- •Computer graphics and image processing