String Escape / Unescape
Free online string escape and unescape tool. Escape strings for JSON, JavaScript, HTML, XML, CSV, SQL, unicode \uXXXX, and backslash contexts right in your browser.
Convert text to hexadecimal and hex back to text right in your browser, with correct UTF-8 encoding, spacing choices, and 0x or backslash-x output styles.
A Text to Hex Converter turns readable text into the hexadecimal bytes computers store, and turns those bytes back into text.
It works in both directions, uses proper UTF-8 encoding, and updates live as you type so you can check output instantly.
Every character maps to one or more bytes, and each byte is written as a two-digit hex number from 00 to ff.
The letter A, for example, is byte 65, which is 41 in hexadecimal.
Because the tool uses TextEncoder and TextDecoder, characters like emoji and accented letters encode to the correct multi-byte UTF-8 sequences.
You can space the bytes apart for readability or keep them continuous for a compact dump.
Optional 0x and \x prefixes match the escape styles used in source code and shell strings.
Going the other way, the decoder tolerates spaces, 0x, and \x so you can paste hex from almost anywhere and read it back as text.
Hexadecimal shows up constantly in debugging, so seeing the exact bytes behind a string is genuinely useful.
It pairs naturally with a Text to Binary Converter when you want to compare the same characters as bits rather than bytes.
For transport-safe payloads you might instead reach for a Base64 Encode Decode tool, and to reason about single values across systems a Number Base Converter moves cleanly between hex, decimal, and binary.
Each character is encoded to its UTF-8 bytes, and every byte is written as a two-digit hexadecimal number from 00 to ff. So a space becomes 20 and the letter A becomes 41. Multi-byte characters such as emoji produce several hex pairs in sequence.
Yes. The converter uses the browser's TextEncoder and TextDecoder, which handle the full UTF-8 range. Accented letters, non-Latin scripts, and emoji all encode to their correct multi-byte sequences and decode back exactly.
Yes. When decoding, the tool strips 0x and backslash-x markers, commas, and whitespace, then reads the remaining hex digits in pairs. That means you can paste hex copied from code, logs, or a memory dump without cleaning it first.
No. All encoding and decoding happens locally in your browser with JavaScript. Nothing you type is sent to a server, logged, or stored, and the tool keeps working offline once the page has loaded.