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.
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 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 inspection. Embedded developers represent firmware strings 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.
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 TextEncoder and TextDecoder APIs.
- 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.