JSON Escape / Unescape
Escape raw text into a JSON string literal, or unescape one back to plain text.
Entrada
Saída com escape
O resultado aparecerá aqui.
O que é JSON Escape / Unescape?
A JSON string escaper/unescaper converts raw, multi-line text into a single-line JSON string literal — replacing characters that JSON's string syntax forbids or treats specially (double quotes, backslashes, newlines, tabs, and other control characters) with their backslash-escaped equivalents (\", \\, \n, \t, and \u00XX for other control codes). This is exactly what JSON.stringify() does to a string value, but exposed as a standalone tool so you can escape text that isn't attached to any larger object — useful when you're hand-writing a JSON payload, embedding a code snippet or log line inside a config file's string field, or debugging why a string with a literal quote in it broke a JSON parser. Unescaping does the reverse: given an escaped string (with or without its surrounding double quotes), it decodes the escape sequences back into the original raw text.
Como usar JSON Escape / Unescape
- Switch to the "Escape" tab, then type or paste the raw text you want to embed as a JSON string value.
- The escaped, JSON-safe version appears instantly on the right, ready to paste inside a JSON document.
- Switch to "Unescape" to go the other way — paste an escaped string (quoted or not) and get the original text back.
- Use the copy button to grab the result without needing to select it manually.
Exemplos
Escaping a multi-line snippet
Entrada
Line one Say "hello"
Saída
"Line one\nSay \"hello\""
Unescaping back to raw text
Entrada
"a\tb\\c"
Saída
a b\c
Erros comuns
- Pasting already-escaped text into Escape mode again, which double-escapes every backslash.
- Forgetting that a literal backslash in your source text must itself become \\ — a single \ before an unsupported letter is invalid JSON.
- Assuming Unicode characters need \u-escaping — they don't; only control characters and " / \ require it in standard JSON.
Por que usar esta ferramenta
- Runs entirely in your browser — no text you escape or unescape is ever sent to a server.
- Accepts escaped input with or without surrounding quotes, so you don't have to manually add them before unescaping.
- Faster than manually hand-escaping quotes and newlines when embedding a snippet inside a JSON config or payload.