This page works on JSON text in a single box: remove the formatting whitespace, escape quotes and backslashes so the text can be embedded in a string, undo that escaping, or reprint the document with 4-space indentation.
Runs locally in your browserThis page works on JSON text in a single box: remove the formatting whitespace, escape quotes and backslashes so the text can be embedded in a string, undo that escaping, or reprint the document with 4-space indentation.
All four operations run in the browser and the text is never uploaded. Minify and Format validate the input first and leave it untouched when it is not valid JSON; Escape and Unescape are text transforms that also work on fragments.
Minify walks the text and removes spaces, tabs and line breaks only outside string literals, so the double space in "two words" survives while the indentation around it goes away. The input must parse as strict JSON first; if it does not, the text is left alone and the status line shows why.
The result is not a ZIP or gzip file: nothing is compressed byte-wise, the text simply gets shorter because removable whitespace is gone. The status line reports the exact character count before and after.
Escape converts every backslash to a doubled backslash and every quote to a backslash-quote, which is what embedding JSON in a JavaScript or JSON string requires. Unescape runs a single left-to-right pass over the text and reverses exactly those two sequences.
Other escape sequences are not interpreted: \n, \t and \uXXXX pass through Unescape unchanged, and Escape does not touch them either. Because the pair round-trips every tested sequence, escaped output can be unescaped back to the original text.
Format JSON parses the document and reprints it with 4-space indentation. Because the document is re-serialised, number literals are normalised — 1.0 prints as 1 — and \uXXXX escapes become the characters they denote.
The parser is strict JSON: comments, single quotes and trailing commas are rejected. There is no server-side size limit; the practical limit is the browser’s memory, and Copy hands over the current text of the box.