JSON Escape / Unescape Online
Escape or unescape JSON strings instantly in your browser.
When to use JSON Escape / Unescape
Inspect escaped string content for quotes, backslashes, and control characters. This page works on string text, not whole JSON documents, and Unescape validates JSON string syntax.
How to use JSON Escape / Unescape
- Choose Escape or Unescape before pasting text, or load the sample for that mode.
- Read the live output. Escape returns string content without enclosing double quotes.
- Copy the result and verify it with the JSON serializer or parser used by your application. Switching modes reprocesses the existing input rather than moving output into input.
Worked example
Input text: Hello, "World"!
Escape output: Hello, \"World\"!
Unescape input: "hello"
Unescape output: helloHow the tool handles input
Escape doubles backslashes, escapes double quotes and common whitespace controls, and encodes remaining ASCII control characters plus DEL as four-digit Unicode escapes. Unescape parses one layer of JSON string escapes, including Unicode, backspace, form feed, and escaped slashes. Bare content preserves its whitespace. For a quoted string, surrounding whitespace is ignored.
Limitations
Input beginning with a double quote after trimming is treated as a complete JSON string literal. To decode a literal quote in bare content, escape it first. Raw tabs and newlines are invalid in Unescape mode; use their escaped forms or use Escape on raw text. Error wording comes from the browser JSON parser. This tool does not validate objects, repair JSON, or encode text for HTML, SQL, or a shell.
Frequently asked questions
Does Escape return a complete JSON string literal?
No. It returns escaped content without enclosing quotes. Use a real JSON serializer when embedding strings in a complete document.
Does Unescape validate JSON syntax?
Yes, for JSON string syntax. It accepts a quoted JSON string or escaped content without enclosing quotes. Invalid escapes, raw control characters, and unescaped quotes produce an error.
Can I rely on exact round trips for backslashes?
Yes. Unescape parses one layer, so literal backslashes remain literal when decoding Escape output. Leading and trailing whitespace in bare content is preserved.