JSON Escape / Minify / Validate
Escape, unescape, minify or validate JSON strings.
About JSON Escape / Minify / Validate
JSON strings need escaping: quotes, backslashes, and control characters must be written as backslash sequences inside string literals. This tool handles the round trip — escape arbitrary text into a valid JSON string literal, unescape an escaped string back to readable text, minify JSON by stripping whitespace, or validate syntax with precise error messages.
Typical uses: embedding user content into JSON payloads safely, reading escaped strings from API logs, shrinking JSON before storage or transmission, and finding the exact character that breaks a parse (the validator reports the offset, not just "invalid JSON"). The minifier is also a quick sanity check — valid JSON always survives minification unchanged.
All four operations run locally via the native JSON engine. Input never leaves the browser, which matters when handling API tokens, session data, or production payloads you cannot paste into random websites.
Frequently Asked Questions
What characters get escaped in a JSON string?
Double quotes, backslashes, and control characters (newline, tab, carriage return, and others below U+0020). The tool outputs the standard shortest form, matching JSON.stringify.
Minify vs. escape — what is the difference?
Minifying removes insignificant whitespace from a JSON document. Escaping converts arbitrary text into a single JSON string literal. They solve different problems; minify documents, escape text fragments.
The validator says invalid — how do I find the problem?
The error message includes the parser's position. Common culprits: trailing commas, single quotes instead of double quotes, unescaped newlines inside strings, and JavaScript object keys without quotes.