How to Convert Between Number Systems (Binary, Hex, Octal)
Developers regularly work with binary, hexadecimal, and octal numbers. Learn conversion techniques and when each number system is used.
Key Takeaways
- Computers operate in binary (base-2), but humans find large binary numbers unreadable.
- Hex uses digits 0-9 and letters A-F.
- Octal (base-8) uses digits 0-7.
- It's essential for understanding bitwise operations, subnet masks, file permissions (chmod 755 = 111 101 101), and hardware-level data representation.
Hash Generator
Generate SHA-1, SHA-256, SHA-384, SHA-512 hashes from text
Number Systems in Computing
Computers operate in binary (base-2), but humans find large binary numbers unreadable. Hexadecimal (base-16) provides a compact representation where each hex digit maps to exactly 4 binary bits.
Hexadecimal
Hex uses digits 0-9 and letters A-F. It's used for memory addresses, color codes (#FF6B35), MAC addresses (00:1A:2B:3C:4D:5E), and byte-level data representation. Two hex digits represent one byte (0x00 to 0xFF = 0 to 255).
Binary
Binary uses only 0 and 1. It's essential for understanding bitwise operations, subnet masks, file permissions (chmod 755 = 111 101 101), and hardware-level data representation.
Octal
Octal (base-8) uses digits 0-7. Its primary modern use is Unix file permissions where each digit represents read (4), write (2), and execute (1) for owner, group, and others.
Conversion Table
| Decimal | Binary | Hex | Octal |
|---|---|---|---|
| 10 | 1010 | A | 12 |
| 255 | 11111111 | FF | 377 |
| 42 | 101010 | 2A | 52 |
| 100 | 1100100 | 64 | 144 |
Ilgili Araclar
Ilgili Formatlar
Ilgili Rehberler
JSON vs YAML vs TOML: Choosing a Configuration Format
Configuration files are the backbone of modern applications. JSON, YAML, and TOML each offer different trade-offs between readability, complexity, and tooling support that affect your development workflow.
How to Format and Validate JSON Data
Malformed JSON causes silent failures in APIs and configuration files. Learn how to format, validate, and debug JSON documents to prevent integration errors and improve readability.
Base64 Encoding: How It Works and When to Use It
Base64 converts binary data into ASCII text, making it safe for transmission through text-based systems. Learn when Base64 is the right choice and when alternatives like hex encoding or URL encoding are more appropriate.
Best Practices for Working with Unix Timestamps
Unix timestamps provide a language-agnostic way to represent points in time, but they come with pitfalls around time zones, precision, and the 2038 problem. This guide covers best practices for storing and converting timestamps.
Troubleshooting JWT Token Issues
JSON Web Tokens are widely used for authentication but can be frustrating to debug. This guide covers common JWT problems including expiration errors, signature mismatches, and payload decoding issues.