🔢 Number Base Converter
Convert between binary, octal, decimal, and hexadecimal
📚 User Guide
Number Base Guide
- Binary: Base 2, uses digits 0 and 1
- Octal: Base 8, uses digits 0-7
- Decimal: Base 10, uses digits 0-9
- Hexadecimal: Base 16, uses digits 0-9 and letters A-F
Base in Programming
JavaScript:
- Binary: 0b1111 or 0B1111
- Octal: 0o17 or 0O17
- Decimal: 15
- Hexadecimal: 0xF or 0XF
Python:
- Binary: 0b1111
- Octal: 0o17
- Decimal: 15
- Hexadecimal: 0xF
C/C++/Java:
- Octal: 017
- Decimal: 15
- Hexadecimal: 0xF
Conversion Examples
| Decimal | Binary | Octal | Hexadecimal |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 |
| 8 | 1000 | 10 | 8 |
| 15 | 1111 | 17 | F |
| 16 | 10000 | 20 | 10 |
| 255 | 11111111 | 377 | FF |
Use Cases
- Low-level computer programming
- Bitwise operations
- Color code conversion
- Network address calculation
- File permission settings
Tips
- Hexadecimal is commonly used for memory addresses and colors
- Binary is used to understand bitwise operations and masks
- Octal is common in Unix/Linux permissions (e.g., chmod 755)
- Decimal is the most commonly used base in daily life