Text to Hex Converter
Convert any text to its UTF-8 hexadecimal byte representation.
or drop a file here
Separator
Hex Output
How Text-to-Hex Conversion Works
Each character in your text is first encoded to its UTF-8 byte sequence, then each byte is expressed as a two-digit hexadecimal number (00–FF). ASCII characters like A map to a single byte (41), while accented letters and emoji span two to four bytes each. The separator option controls how the hex pairs are joined — spaces and commas are human-readable; no separator gives a compact string; the 0x prefix follows C and JavaScript literal conventions. All processing runs entirely in your browser.
Built and maintained by Meet Shah · Last updated
What this tool is used for
- Producing the hex bytes of a string to compare against what a protocol trace shows.
- Building a hex literal for a test that asserts on exact bytes.
- Checking which bytes a non-ASCII character actually occupies.
- Preparing a hex payload for a tool that accepts byte sequences rather than text.
- Spotting an invisible character by its byte value rather than its appearance.
Frequently Asked Questions
- Are these character codes or bytes?
- Bytes, encoded as UTF-8. That is the important distinction: "A" is one byte (41), "é" is two (C3 A9), and an emoji is four. A per-character conversion would give one number per character and be wrong for most of Unicode.
- Why does one emoji produce eight hex digits?
- Because it is four bytes. 🌍 is U+1F30D, which UTF-8 encodes as F0 9F 8C 8D. The code point and the bytes are different things — the hex here is what would actually travel over a wire or sit in a file.
- Which separator should I use?
- Spaces for reading, none for pasting into code that expects a contiguous hex string, and `\x` prefixes for a C or Python literal. The unseparated form is unambiguous because every byte is exactly two hex digits.
- Why is hex used rather than decimal?
- Because two hex digits are exactly one byte, so the boundaries are visible and the alignment never shifts. Decimal bytes vary between one and three digits, which is why every hex dump ever written uses base 16.
- How do I read a hex dump?
- Look for the signature at the start: `FF D8 FF` is a JPEG, `89 50 4E 47` is a PNG, `25 50 44 46` is `%PDF`, and `50 4B 03 04` is a ZIP — which includes every Office document and JAR. That first handful of bytes identifies a file more reliably than its extension.
- Should the output be uppercase or lowercase?
- Either is valid; consistency is what matters. Lowercase is conventional in hashes and web contexts, uppercase in memory dumps and MAC addresses — and a comparison between the two forms fails unless one is normalised.
Common errors and gotchas
- Assuming one character is one byte, which stops being true for anything outside ASCII.
- Omitting a separator, after which a two-digit and a four-digit value cannot be told apart.
- Losing a leading zero on a byte below 0x10, which shifts every pair after it.
- Not recording the encoding, since the same text gives different bytes in UTF-8 and UTF-16.
- Treating the output as obfuscation when it is a direct and reversible view of the same data.
Related Converters tools
JSON to YAML
Convert JSON into clean, readable YAML instantly.
YAML to JSON
Convert YAML configuration into valid JSON.
JSON to XML
Convert JSON structures into nested XML markup.
HWB to HEX Converter
Convert an HWB color to HEX.
JSON to SQL
Turn a JSON array of objects into SQL INSERT statements.
CSV to XML
Convert CSV rows into structured XML records.
XML to CSV
Flatten repeated XML records into CSV rows.
INI to JSON
Parse INI config sections and keys into JSON.