Hex Encoder / Decoder
Encode text to hexadecimal or decode hex strings back to text. UTF-8 supported.
About This Tool
The Hex Encoder / Decoder converts text to hexadecimal byte sequences and back again. In Text β Hex mode, each character is first encoded to its UTF-8 byte sequence and then each byte is represented as a two-digit hex value. In Hex β Text mode, a hex string is parsed back into bytes and decoded from UTF-8 to readable text.
Full UTF-8 is supported β emoji, CJK characters, accented letters, and all other multi-byte Unicode characters are handled correctly. You can choose between uppercase and lowercase hex digits, and select a separator (space, none, dash, or colon) to match the format expected by your target system.
How to Use
- Choose a mode: Text β Hex to encode plain text, or Hex β Text to decode hex back to text.
- In encode mode, select uppercase/lowercase and a byte separator to match your requirements.
- Paste or type your input. Click Sample to load an example.
- Click Convert to run the conversion.
- Click Copy to copy the result to your clipboard.
Use Cases
Network engineers encode protocol payloads to hex for manual inspection or packet crafting. Embedded developers represent firmware strings or sensor data as hex byte arrays. Security researchers convert obfuscated text blobs to hex to analyze byte-level structure. Web developers debug encoding issues by checking exact byte values for suspicious characters. Database admins inspect binary column values stored as hex in query results.
FAQ
- Why do some characters produce more than two hex digits? β Multi-byte UTF-8 characters (emoji, CJK, etc.) need 2β4 bytes each. Each byte becomes two hex digits, so an emoji like π produces 8 hex digits (4 bytes).
- What separators does the decoder accept? β The decoder strips all whitespace before parsing, so space-separated, dash-separated, colon-separated, or unseparated hex input all decode correctly.
- Is my data sent to a server? β No. All encoding and decoding runs entirely in your browser using JavaScript's built-in
TextEncoderandTextDecoderAPIs. - What if I get "Bytes are not valid UTF-8"? β The hex bytes do not form a valid UTF-8 sequence. This can happen if the original data was not text (e.g., a binary file) or used a different encoding like Latin-1 or Windows-1252.