Loading…
Escape or unescape JSON strings. Use when embedding JSON; for formatting use json-formatter. Input: JSON ≤10MB. Returns escaped string. 100% client-side, files never leave browser.
JSON Escaper is loading — interactive editor will appear here. Use examples below to try instantly once loaded.
Press ? for keyboard shortcuts
Escapes raw text into a JSON string (quotes, backslashes, newlines, Unicode \uXXXX) and unescapes JSON strings back to raw. Handles nested JSON where a string contains stringified JSON.
Logs and API responses often contain nested JSON that must be pasted into code. Manual escaping is error-prone; this does it correctly per RFC 8259 and reverses it without losing Unicode.
This tool is part of the DevStackIO platform — a collection of free online developer tools from DevStackIO. Browse more free developer resources on DevStackIO.
Developers working with logs, API payloads, and code generation where JSON strings contain JSON.
Paste text in Input, choose Escape (with options: wrap quotes, Unicode) or Unescape.
Escape uses JSON.stringify slicing; Unescape tries JSON.parse with quote wrapping then manual \n/\u fallback.
Copy the output from the preview (data-testid). No upload — pure string ops.
Input: Hello\nWorld → Escape → "Hello\nWorld" (with quotes) or Hello\nWorld (without).Input: "\"a\"" → Unescape → "a" (or {"a":1} nested).Is it the same as String Escape?
JSON escaping is a subset (quotes/backslashes/controls); String Escape also handles HTML/URL.
Does it handle surrogate pairs? Yes
Unicode above U+FFFF is preserved or escaped as \uXXXX pairs.
Is it reversible?
Escape then Unescape round-trips for valid JSON strings.
Authoritative specifications, standards, and in-depth reading for JSON Escaper.
Hello \"world\"\nLine 2 with \\ backslash and unicode: café 🎉
How it works
Free online JSON formatter and validator with syntax highlighting and error line numbers. Use as default for beautify+validate+minify in one place; for two-file comparison use json-diff, for schema generation use json-schema-generator. Input: JSON ≤10MB. Returns formatted JSON or line-numbered error. 100% private.
Compare two JSON documents and highlight added, removed, and changed keys with line-level diff. Use when comparing API responses or configs; for single-document formatting use json-formatter, for validation errors use json-validator. Input: two JSON texts ≤10MB. Returns highlighted diff. 100% client-side.
Compress JSON by stripping whitespace for smallest payload. Use when preparing production payloads; for readable output use json-formatter or json-beautifier. Input: JSON text ≤10MB. Returns minified JSON or line-numbered error. 100% client-side.
Validate JSON syntax and report errors with line numbers without reformatting. Use when only correctness matters; for auto-fix and formatting use json-formatter. Input: JSON text ≤10MB. Returns valid/invalid + error location. 100% client-side.
Format and validate HTML with indentation and error reporting. Use as default HTML tool; for minifying production HTML use html-minifier, for converting HTML to Markdown use html-to-markdown. Input: HTML ≤10MB. Returns formatted HTML or validation errors. 100% client-side.
Format or minify CSS with indentation control. Use as default CSS tool handling both directions; css-minifier URL is a noindex alias. Input: CSS ≤10MB. Returns formatted or minified CSS. 100% client-side.
Minify JS for production or beautify minified JS for debugging. Use for JS only; for JSON use json-formatter, for CSS use css-formatter. Input: JS text ≤10MB. Returns minified or beautified JS or syntax error. 100% client-side.
Free online SQL formatter with indentation and keyword casing. Format queries privately in browser.