Escape and unescape JSON strings. Fast, secure, and completely free. All processing happens in your browser — no data is sent to any server.
JSON escaping converts special characters — double quotes, backslashes, newlines, tabs — into their backslash-escaped equivalents (\", \\, \n, \t) so a string can be safely embedded as a JSON string value without breaking the surrounding structure. This is different from formatting a JSON document; it's specifically about taking a raw piece of text (like a multi-line log message or a snippet of code) and turning it into something that can sit inside a JSON string literal without prematurely closing the quotes or corrupting control characters.
Embedding arbitrary text inside a JSON string by hand is a common source of subtle bugs: a stray double quote breaks the JSON structure, an unescaped backslash from a Windows file path (C:\Users\...) gets misread, and a raw newline inside a string literal is actually invalid JSON. This tool handles all of those cases correctly in one pass, which matters most when you're constructing JSON payloads manually, embedding log messages or code snippets as string values, or debugging why a hand-written JSON string won't parse.
The formatter re-indents a whole valid JSON document; this tool escapes or unescapes a single piece of raw text so it can safely become one JSON string value, which is a different, more granular operation.
Backslash is JSON's escape character, so a literal backslash must itself be escaped as \\ or the parser would treat the character after it as the start of an escape sequence.
Yes — most emoji pass through unescaped since they're valid inside JSON strings, though the tool correctly escapes any control characters mixed into the same text.
Since there's nothing to unescape, the output matches the input unchanged — unescaping only affects recognized backslash sequences.
Yes — escaping only prepares the inner content; you still need to add the surrounding double quotes yourself to form a complete JSON string value.