Text to Hex Converter
Convert text to hexadecimal bytes and hex back to text, with UTF-8, Latin-1 or UTF-16LE, custom separators and 0x or \x prefixes.
Tool guide
What this tool does
Text to Hex Converter shows the exact bytes behind your text as hexadecimal values and reverses the process. Choose the character set, byte separator, prefix, letter case and bytes per line, and paste hex in almost any common format to decode it.
Computers store text as bytes, and hexadecimal is the standard way to show them: each byte is two digits from 00 to FF. Seeing the hex is the quickest way to spot a byte-order mark, a stray carriage return, a non-breaking space, or the difference between a straight and a curly quote. The same text produces different bytes in different encodings: “é” is E9 in Latin-1, C3 A9 in UTF-8 and E9 00 in UTF-16LE.
This converter encodes text with the character set you pick and formats the bytes the way your target expects: space-separated for reading, no separator for compact strings, colon-separated like MAC addresses, 0x prefixes for C arrays, \x escapes for Python or shell strings, or % for URLs. When decoding it accepts all of those formats, ignores whitespace and punctuation between bytes, and reports invalid digits or an odd digit count. Processing is local to your browser.
How to use Text to Hex Converter
- Enter text, or paste hexadecimal data, in the Input box.
- Choose “Text to hex” or “Hex to text” under Mode.
- Select the character set that matches your data; UTF-8 is the usual choice.
- Pick a byte separator, prefix and letter case for the output.
- Set “Bytes per line” to 16 for a classic hex-dump layout, then copy or download the result.
Tips for better results
- ASCII letters and digits are the same single byte in UTF-8 and Latin-1, so differences only appear with accented letters and symbols.
- A UTF-8 file starting with EF BB BF has a byte-order mark, which can break CSV imports and shell scripts.
- Windows line endings show up as 0D 0A, Unix line endings as 0A.
- To compare encodings, convert the same text twice with different character sets.
Common use cases
- Checking what bytes a form field or database column really contains.
- Building a byte array for firmware, a test fixture or a network packet.
- Decoding hex strings found in logs, packet captures or smart-contract data.
- Teaching how UTF-8 encodes multi-byte characters.
Common mistakes to avoid
- Decoding UTF-16 bytes as UTF-8, which produces text with null characters or errors.
- Dropping a leading zero, such as writing “A” instead of “0A”; every byte needs exactly two digits.
- Confusing a number’s hex value with text hex: the text “255” is 32 35 35, while the number 255 is FF. Use Number Base Converter for numbers.
Frequently asked questions
What hex formats can I paste for decoding?
Plain digits (48656c6c6f), space, colon, dash or comma separated bytes, 0x-prefixed values, \x escapes and %-encoded bytes all work. Upper and lower case are both accepted.
Why do some characters produce several bytes?
UTF-8 uses one byte for ASCII, two for most Latin, Greek and Cyrillic letters, three for most Asian scripts and symbols such as ✓, and four for emoji.
What happens if the hex is not valid text?
You will see an error explaining that the bytes are not valid UTF-8. Switch on “Replace invalid UTF-8 when decoding” to view the text with replacement characters, or decode as Latin-1.
Feedback & suggestions
Help us improve Text to Hex Converter. We read every message.