Number Base Converter
Convert numbers between decimal (base 10), hexadecimal (base 16), binary (base 2), and octal (base 8) instantly. Type in any field and all other bases update automatically. Supports positive integers up to 253.
Number Systems Explained
Decimal (Base 10)
The number system humans use daily. Uses digits 0–9. Each position represents a power of 10. Example: 255 = 2×100 + 5×10 + 5×1.
Hexadecimal (Base 16)
Uses digits 0–9 and letters A–F. Each hex digit represents exactly 4 bits. Widely used in programming, color codes, memory addresses, and cryptographic hashes.
Binary (Base 2)
The fundamental language of computers. Uses only 0 and 1. Every piece of data in a computer is ultimately stored and processed as binary. Each digit is called a bit.
Octal (Base 8)
Uses digits 0–7. Each octal digit represents exactly 3 bits. Used in Unix/Linux file permissions (e.g., chmod 755) and some legacy computing systems.
Common Use Cases
- Hex colors — CSS color
#FF5733is three hex pairs: R=255, G=87, B=51 - Memory addresses — debuggers and hex editors display addresses in hexadecimal
- File permissions — Unix chmod uses octal:
755= rwxr-xr-x - Bitwise operations — understanding binary is essential for bitwise AND, OR, XOR, and shift operations
- Network masks — subnet masks like 255.255.255.0 are easier to understand in binary
- ASCII codes — character codes are often shown in decimal and hex simultaneously
- Cryptography — hash values and keys are displayed in hexadecimal
Quick Reference Table
| Dec | Hex | Binary | Octal |
|---|
Use the Hash Generator to create MD5, SHA-256, and SHA-512 hashes from any text.
Understanding Number Systems in Computing
Number systems are the foundation of how computers store, process, and display data. While humans naturally use the decimal (base 10) system, computers operate in binary (base 2) at the hardware level. Hexadecimal (base 16) and octal (base 8) are used as convenient shorthand representations for binary data. Understanding how to convert between these systems is an essential skill for any developer, especially when working with low-level programming, networking, cryptography, or hardware.
Why Hexadecimal Is So Common in Programming
Hexadecimal is the most widely used alternative number system in software development because it maps perfectly to binary — each hex digit represents exactly 4 bits (a nibble), and two hex digits represent exactly one byte. This makes hex an extremely compact and readable way to express binary data:
- Memory addresses — debuggers and hex editors display addresses like
0x7FFF5FBFF8A0 - Color codes — CSS colors like
#FF5733are three hex pairs representing R, G, B values - Cryptographic hashes — SHA-256 outputs are displayed as 64 hex characters (256 bits)
- Unicode code points — characters are identified by hex values like
U+1F600 - Network MAC addresses — displayed as six hex pairs like
00:1A:2B:3C:4D:5E - IPv6 addresses — expressed as eight groups of four hex digits
Binary and Bitwise Operations
Understanding binary is essential for working with bitwise operators in programming. Bitwise AND (&), OR (|), XOR (^), NOT (~), and shift operators (<<, >>) all operate directly on the binary representation of numbers. Common use cases include:
- Setting, clearing, and toggling individual bits in a flags variable
- Fast multiplication and division by powers of 2 using bit shifts
- Checking if a number is even or odd with
n & 1 - Implementing permission systems where each bit represents a different access right
- Network subnet mask calculations
Octal and Unix File Permissions
Octal (base 8) is most commonly encountered in Unix and Linux file permission systems. The chmod command uses octal numbers to set read (4), write (2), and execute (1) permissions for owner, group, and others. For example, chmod 755 sets permissions to rwxr-xr-x — owner has full access (7=4+2+1), group and others have read and execute (5=4+1).
Related Tools
- Hash Generator — generate MD5, SHA-256, SHA-512 hashes (output displayed in hex)
- Timestamp Converter — convert Unix timestamps to readable dates
- URL Encoder — percent-encode URLs (uses hex values internally)
- JWT Decoder — decode JWT tokens that use Base64URL encoding
- JSON Formatter — format and validate JSON data