๐ Hex Encoder
๐ Hex Decoder
๐งช Example Hex Operations
Click an example to see hexadecimal encoding in action
๐ Understanding Hexadecimal Encoding
Hexadecimal encoding (hex, base-16) is a positional numeral system that uses 16 distinct symbols to represent values. It's one of the most fundamental encoding systems in computer science.
How Hexadecimal Works:
- 16 Symbols - Uses 0-9 (values 0-9) and A-F (values 10-15)
- Byte Representation - Each byte (8 bits) is represented by exactly 2 hex digits (00-FF)
- Compact Format - More compact than binary (4:1 ratio), more readable than decimal for binary data
- Bit Groups - Each hex digit represents exactly 4 bits (a nibble)
- Common Notation - Often prefixed with 0x (e.g., 0x4A) or suffixed with h (e.g., 4Ah)
Common Use Cases:
- Cryptographic Hashes - MD5, SHA-256 and other hashes are displayed in hex
- Color Codes - Web colors like #FF5733 (Red=FF, Green=57, Blue=33)
- Memory Addresses - 0x7FFFFFFF, pointer values in debugging
- Binary File Analysis - Hex editors display file contents in hexadecimal
- Network Protocols - MAC addresses (00:1A:2B:3C:4D:5E), packet analysis
- Character Encoding - Unicode code points (U+0041 = 'A')
Hex to Decimal Conversion:
- 0-9 - Same as decimal (0-9)
- A - 10 (decimal)
- B - 11 (decimal)
- C - 12 (decimal)
- D - 13 (decimal)
- E - 14 (decimal)
- F - 15 (decimal)
- FF - 255 (max byte value)
Example Conversions:
- 'A' - Character code 65 = 0x41 in hex
- 'Hello' - 48 65 6C 6C 6F in hex
- 255 - FF in hex (maximum byte value)
- Red Color - #FF0000 = Red=255, Green=0, Blue=0
- MAC Address - 00:1A:2B:3C:4D:5E (6 bytes in hex)
Best Practices:
- Use uppercase (FF) or lowercase (ff) consistently
- Add 0x prefix when hex notation might be ambiguous
- Pad single digits with leading zero (0x0A, not 0xA) for clarity
- Use hex for displaying binary data, hashes and memory dumps
- Group hex digits for readability (FF:5E:3A or FF5E3A)
- Consider Base64 for more compact text representation
โ ๏ธ Privacy Note: All encoding and decoding happens locally in your browser. No data is transmitted to servers.
โ Frequently Asked Questions
Hexadecimal (hex) encoding is a base-16 numbering system that uses 16 symbols: 0-9 for values zero to nine and A-F for values ten to fifteen. Each hex digit represents 4 bits, so two hex digits represent one byte (8 bits). For example, the letter 'A' (ASCII 65) is represented as '41' in hexadecimal. It's widely used because it provides a compact, human-readable way to represent binary data.
Use hex encoding for: displaying cryptographic hashes (MD5, SHA-256), representing color codes in web design (#FF5733), debugging binary files and memory dumps, displaying MAC addresses and IPv6 addresses, network packet analysis, representing byte arrays in programming, low-level system programming and data inspection where binary would be too verbose.
Hex encoding uses 16 characters (0-9, A-F) and represents each byte as 2 characters, resulting in 100% size increase. Base64 uses 64 characters and represents 3 bytes as 4 characters, resulting in only 33% size increase. Hex is more readable and commonly used for hashes, addresses and debugging. Base64 is more compact and used for embedding binary data in text formats like JSON, XML or email.
Each byte (8 bits, values 0-255) is represented by exactly two hexadecimal digits. For example: 0x00 = 0, 0xFF = 255, 0x41 = 65 (letter 'A'). The '0x' prefix indicates hexadecimal notation. Each hex digit represents 4 bits: 0=0000, 1=0001, ..., F=1111. So 0xFF means 11111111 in binary, which equals 255 in decimal.
Web colors use hexadecimal because each color channel (Red, Green, Blue) is stored as one byte (0-255) and hex provides a compact way to represent this. For example, #FF5733 means Red=FF (255), Green=57 (87), Blue=33 (51). This 6-character format is more compact than decimal (rgb(255, 87, 51)) and easier to work with than binary. The # symbol indicates a hex color code.
Absolutely! All hexadecimal encoding and decoding happens locally in your browser using JavaScript. No data is ever transmitted to our servers or any third party. You can use this tool completely offline. Your text and binary data never leave your device, ensuring complete privacy and security.