Hex Converter
Free online hex encoder and decoder. Convert text to hexadecimal or decode hex back to plain text. Handles spaces, 0x prefixes, and mixed formatting automatically.
How to Use Hex Converter
Enter Your Data
Type or paste text into the input panel. You can enter regular text to encode, or a hex string to decode.
Choose Direction
Click "Encode to Hex" to convert text to hexadecimal, or "Decode from Hex" to convert hex back to text.
Copy and Use
The converted output appears on the right. Copy it for use in your code, configuration files, or debugging.
Examples
Plain Text
Hello World Hex Encoded
48 65 6c 6c 6f 20 57 6f 72 6c 64 Frequently Asked Questions
What is hex encoding?
Hexadecimal (hex) encoding represents each byte of data as a two-character hex string (00-FF). For example, the letter "A" (ASCII 65) becomes "41" in hex. Hex is widely used in programming for representing binary data in a human-readable format, in color codes (#FF0000), memory addresses, and network packet analysis.
How is hex different from Base64?
Hex uses 16 characters (0-9, A-F) and produces output that's twice the size of the original data (each byte → 2 hex chars). Base64 uses 64 characters and produces output about 33% larger. Hex is easier to read and debug because you can see individual byte values, while Base64 is more compact for transmission.
Can I decode a hex string with spaces?
Yes, the decoder automatically strips whitespace, spaces, line breaks, and "0x" prefixes from the input before decoding. So you can paste hex dumps directly without cleaning them up first.
When to Use Hex Encoding
Hex encoding is the go-to format when you need to inspect binary data at the byte level. Unlike Base64 which obscures individual bytes, hex lets you see exactly what each byte is. This makes it invaluable for debugging, reverse engineering, and working with low-level protocols.
Common Use Cases
- Reading hex dumps from network packet analyzers (Wireshark)
- Inspecting binary file headers and magic numbers
- Working with cryptographic hashes (SHA-256, MD5 outputs)
- CSS color values (#FF5733)
- Encoding binary data in JSON when Base64 isn't suitable