What is Text to Hex?

Text to Hex converts text into hexadecimal bytes. Each character maps to its hex value โ€” useful for debugging, network analysis, and binary protocols.

It defaults to UTF-8, so accented Latin, Cyrillic, CJK, Arabic, and emoji all serialise to the correct byte sequences โ€” and you can switch the encoding to UTF-16, ASCII, or Latin-1 to match a legacy system or protocol. Format the output with a space, colon, comma, or no delimiter, prefix each byte with `0x` for C-style arrays, and flip the case to suit your style guide. Type, paste from the clipboard, or upload a text file. A reverse mode parses hex strings back to text and tolerates extra whitespace or `0x` prefixes.

How to use

  1. Type or paste your text in the input field, hit the Paste button to pull from the clipboard, or upload a text file.
  2. Choose your hex format: encoding (UTF-8, UTF-16, ASCII, Latin-1), delimiter (space, comma, colon, none), prefix (0x), uppercase or lowercase, and optional byte grouping for a hex-dump layout.
  3. Copy the hex output for your code or docs. You can also convert hex back to text.

When to use

  • Inspecting the raw bytes of a string before sending it through a binary protocol.
  • Pasting non-ASCII content into a C, Rust, or Go source file as a byte array.
  • Debugging encoding issues by comparing what's in your data versus what you expected.

Result

Enter 'Hello World' and get '48 65 6C 6C 6F 20 57 6F 72 6C 64' with spaces, or '0x48,0x65,0x6C...' with the 0x prefix for C-style arrays.

FAQ

Which character encoding does the converter use?
UTF-8 by default, with UTF-16, ASCII, and Latin-1 selectable from the Encoding row. In UTF-8, plain ASCII characters end up as one byte each (A โ†’ 41) while emoji and CJK expand to several bytes (๐Ÿ˜€ โ†’ F0 9F 98 80) โ€” matching what files, HTTP bodies, and most APIs send over the wire. Switch to Latin-1 for single-byte legacy text, or ASCII when you want anything above 7 bits flagged.
Why does a single emoji produce four hex pairs instead of one?
Emoji and many non-Latin characters live above the 0x7F boundary, so UTF-8 represents them with two, three, or four bytes. A single emoji glyph like ๐Ÿš€ maps to four hex pairs (F0 9F 9A 80), each pair being one byte of the multi-byte sequence.
Can I paste hex with mixed delimiters and have the reverse mode still work?
Yes. The decoder strips `0x` prefixes, ignores spaces, commas, colons, and dashes, and concatenates everything that looks like a hex digit. So `0x48,0x65 6C-6C:6F` and `48656C6C6F` both round-trip back to "Hello".
What's the difference between using the `0x` prefix and not?
It's a notation choice. `0x48` is the standard form in C, C++, Rust, and Go source code, while plain `48` is what you'll see in hex dumps, packet captures, and most network tools. Use the prefix when pasting into code, drop it for log output.
Is the output suitable for cryptographic uses like hashing?
It gives you the raw UTF-8 bytes, which is the correct first step for most hash and HMAC algorithms โ€” they operate on bytes, not characters. Feed the resulting bytes into your hashing tool. The hex form alone isn't a hash.

Related Tools