About This Tool
Convert numbers between different number systems: binary (base 2), decimal (base 10), hexadecimal (base 16), and octal (base 8). Essential for programming, computer science, and digital electronics.
Binary Converter
Enter a number in any field and the others will update automatically.
Quick Reference
| Decimal | Binary | Hex | Octal |
|---|---|---|---|
| 0 | 0000 | 0 | 0 |
| 1 | 0001 | 1 | 1 |
| 2 | 0010 | 2 | 2 |
| 3 | 0011 | 3 | 3 |
| 4 | 0100 | 4 | 4 |
| 5 | 0101 | 5 | 5 |
| 6 | 0110 | 6 | 6 |
| 7 | 0111 | 7 | 7 |
| 8 | 1000 | 8 | 10 |
| 9 | 1001 | 9 | 11 |
| 10 | 1010 | A | 12 |
| 11 | 1011 | B | 13 |
| 12 | 1100 | C | 14 |
| 13 | 1101 | D | 15 |
| 14 | 1110 | E | 16 |
| 15 | 1111 | F | 17 |
How to Use
- Enter a number in any of the four input fields
- The other three fields will automatically update with the converted values
- Click the copy button next to any field to copy that value
- Use "Clear All" to reset all fields
Number System Basics:
- Binary (Base 2): Uses only 0 and 1. The foundation of digital computing.
- Decimal (Base 10): Our standard counting system using 0-9.
- Hexadecimal (Base 16): Uses 0-9 and A-F. Common in programming for compact representation.
- Octal (Base 8): Uses 0-7. Used in some programming contexts and file permissions.
Frequently Asked Questions
Why do we use different number systems?
Binary is the native language of computers (on/off states). Hexadecimal provides a compact way to represent binary data. Octal was popular in early computing and is still used for Unix file permissions.
What do the prefixes 0b, 0x, and 0o mean?
These are standard programming prefixes: 0b for binary, 0x for hexadecimal, and 0o for octal. They help identify the number system being used.
What's the largest number this can convert?
This tool uses JavaScript's Number type, which can safely handle integers up to 2^53 - 1 (about 9 quadrillion). For larger numbers, use a BigInt-capable tool.
Can I convert negative numbers?
This tool works with positive integers. For negative numbers in binary, you'd typically use two's complement representation, which requires specifying a bit width.
How is hex used in programming?
Hexadecimal is used for colors (#FF0000 for red), memory addresses, character codes, and any time you need a compact way to represent binary data. Each hex digit represents exactly 4 binary digits.