Text to Hex Converter (and back)
Convert text to hexadecimal bytes and decode hex back to text, with UTF-8 support, in your browser.
How to use
- Choose the direction: text to hex, or hex to text.
- For text to hex, pick the byte separator and letter case.
- Paste your input and copy the converted result.
About this tool
ShowHide
Paste text to get its UTF-8 bytes as hexadecimal, or paste hex to decode it back to text. Choose the separator — space, none, colon or \x — and upper or lower case, so the output drops straight into a C array, a Wireshark filter or a shell command. Because the encoding is UTF-8 and not one byte per character, an accented letter takes two bytes and most emoji take four; the byte count is the real answer to how long a string is on the wire. Decoding is deliberately forgiving: 0x and \x prefixes and every non-hex character are stripped before parsing, so hex copied from a hex editor, a log line or a packet dump all work. An odd number of digits is reported as an error rather than guessed at.
Frequently asked questions
How are non-ASCII characters handled?
Text is encoded as UTF-8 first, so accented letters, emoji and CJK characters become their multi-byte hex sequences and decode back exactly.
What hex formats can I decode?
Any. Spaces, colons, newlines and 0x or \x prefixes are stripped, then the remaining hex digits are read two at a time. An odd number of digits is reported as an error.
What does the separator option do?
It sets how bytes are joined when encoding: a space (48 65), nothing (4865), a colon (48:65) or a \x prefix (\x48\x65). Decoding accepts all of these.
Is my text sent anywhere?
No. The conversion happens entirely in your browser; nothing is uploaded.
Why is my emoji four bytes and my accented letter two?
Because UTF-8 is variable-width. ASCII characters take one byte, most accented and Greek or Cyrillic letters take two, most CJK characters three, and emoji and rarer symbols four. That is why a byte count and a character count disagree, and why a database column sized in bytes runs out sooner than expected.
Why does an odd number of hex digits fail?
Because a byte is two hex digits, so an odd count means one digit is missing and there is no safe way to guess which end. Rather than pad a nibble and hand back plausible-looking wrong bytes, it reports the error — usually a sign that a copied dump was truncated.
Guides on this topic
Related tools
Text to Binary Converter
Convert text to 8-bit binary and back. UTF-8 encoded, so emoji and accented characters work, with a choice of byte separator.
Convert
Base64 to Hex Converter (and back)
Convert a Base64 string to hexadecimal bytes and hex back to Base64, with URL-safe support, in your browser.
Developer
ASCII Code Table
Browse and search the 256-row ASCII / extended-ASCII table — decimal, hex, octal, binary, and the named control characters.
Developer
Image → ASCII Art
Convert any image to ASCII art with adjustable width, character set, and inversion — all in your browser.
Image
Folder Tree Visualizer
Paste an indented list of file and folder names and get a pretty ASCII tree — the kind you'd paste into a README.
Text
Number Base Converter
Convert numbers between binary, octal, decimal, and hexadecimal.
Convert