JSON Escape / Unescape
🔒 In your browserEscape text into a JSON string, or unescape it back.
—Escape turns text into a JSON string literal (quotes, newlines, tabs escaped) — handy for embedding JSON inside JSON.
About the JSON Escape / Unescape
Embedding JSON inside a string — for a log, a code literal or another JSON payload — means escaping quotes and special characters. This free JSON escape/unescape tool converts text into a safely escaped JSON string literal, and unescapes it back, so you don't have to do it by hand.
It runs in your browser and keeps your data private.
How to escape and unescape JSON
- Paste text or JSON to escape it into a valid JSON string literal.
- Or paste an escaped string to turn it back into readable text.
- Quotes, backslashes and control characters are handled correctly.
When you need to escape JSON
Escaping matters whenever JSON or text has to live inside another string: putting a JSON payload into a log line, embedding it in a code constant, or nesting it inside another JSON field. Escaping converts quotes, backslashes and control characters into their safe forms so the whole thing stays valid; unescaping turns an escaped string back into readable text.
Frequently asked questions
What does escaping JSON mean?
It converts characters like double quotes, backslashes and newlines into their escaped forms so the text can be safely stored inside a JSON string.
When do I need this?
Whenever you embed JSON or text inside another string — for example putting a JSON payload into a log line, a code constant or a nested JSON field.
Is my data private?
Yes. Escaping and unescaping happen locally in your browser.
What does escaping JSON actually change?
It converts characters like double quotes, backslashes and newlines into escaped forms (\" , \\ , \n) so the text can sit safely inside a JSON string without breaking it.
Related searches
Related Developer tools
🔗 Embed this tool on your website — free
Copy this and paste it into your page's HTML. The tool runs in the visitor's browser, just like here. Change height to fit, or add the optional auto-resize snippet below. Add ?theme=dark to the URL for dark mode.
<iframe src="https://toolhq.dev/embed/json-escape/" title="JSON Escape / Unescape — ToolsHub" width="100%" height="520" style="border:1px solid #e5e7eb;border-radius:12px;max-width:680px" loading="lazy"></iframe>Optional: auto-resize the iframe height
Add this once on the same page so the iframe grows to fit the tool:
<script>
addEventListener("message", function (e) {
if (e.data && e.data.type === "toolshub:resize") {
document.querySelectorAll('iframe[src*="/embed/"]').forEach(function (f) {
if (f.contentWindow === e.source) f.style.height = e.data.height + "px";
});
}
});
</script>