JSON String Escape / Unescape
Escape or unescape text for JSON, JavaScript, Java, C# and SQL string literals. Quotes, backslashes, new lines and Unicode handled. Private.
Text
Stays in your browserResult
Shortcuts: Ctrl+Enter run · Ctrl+Shift+C copy result · / search (use ⌘ on Mac)
Next steps
Done here? Use the Send to… menu on the result to carry it on to JSON Parser or Encode / Decode.
Free Online JSON String Escape and Unescape
Turn text into a string you can put inside quotes in JSON or code, or turn an escaped string back into plain text. It gives developers a quick browser-based way to solve a focused json string escape / unescape task before moving the result into a project.
How to escape a string
Choose Escape or Unescape and the target language, then paste your text. The result updates as you type.
What is converted
Double quotes, backslashes, new lines, tabs and other control characters become backslash sequences. Non-English text and emoji stay as they are.
Worked example
The text He said "hi" followed by a line break becomes, for JSON:
He said \"hi\"\n
Common mistakes
- Escaping twice doubles the backslashes. Unescape once to undo one round.
- JSON does not allow
\x41or\': use\u0041and a plain quote.