Minify JSON Without Breaking Unicode
To minify JSON without turning non-ASCII letters into \uXXXX escapes, parse with JSON.parse and serialize with JSON.stringify (no space argument). Load sample fills the compact object {"name":"John Doe","age":30,"email":"john@example.com","address":{"street":"123 Main St","city":"New York","country":"USA"},"hobbies":["reading","coding","gaming"]} and does not run Prettify, Minify, or Validate. Minify then writes that same compact line. The sample is ASCII (John Doe / age 30 / hobbies) — café / \u00e9 leftovers are a separate paste, not Load sample. This is not the older users / Jane Smith / total leftover. ECMA-262 QuoteJSONString keeps code points above U+001F as characters, except " and \. That is not Python ensure_ascii=True. Nothing is uploaded.
The live JSON formatter Load sample fills that leftover compact object and does not run Minify. Minify then writes the same line. “Broken unicode” after a minify is a different paste: an ASCII-only encoder rewrote café as caf\u00e9. RFC 8259 allows both spellings. The Minify button uses the browser serializer, which keeps the character form for letters outside ASCII.
Load sample Minify leftovers
Load sample fills this compact object and does not run Minify. Minify then writes the same line. age is the number 30. This leftover is ASCII, so it does not demonstrate café or \u00e9.
What JSON.stringify actually writes
Non-ASCII stays a character
Docify minifies with JSON.parse then JSON.stringify(value). QuoteJSONString (ECMA-262) escapes only quote, backslash, and U+0000–U+001F (with the usual \b / \t / \n / \f / \r shortcuts). Letters, CJK, and emoji are written as those characters, not as ASCII \u sequences. This café pair is a separate paste — not the Load sample leftover.
Input escapes are decoded
If the pasted text already uses \u00e9, the parser turns that escape into é. The compact output then contains the character. Both forms are valid JSON strings (RFC 8259 §7). The tool does not preserve the original escape spelling. Load sample has no \u00e9 escape.
Python’s default is the other spelling
CPython json.dumps defaults to ensure_ascii=True, so the same object prints caf\u00e9. Pass ensure_ascii=False to match the browser. Docify never runs that library; this page only names the default so the two outputs are not mistaken for a parse error. Load sample Minify is the compact John Doe line either way, because that leftover is ASCII.
What minify still changes
- Whitespace outside strings is dropped. That is the compact line:
JSON.stringifywith no indent. Load sample is already compact, so Minify writes that same line. - Numbers follow IEEE-754. Values that do not fit a JavaScript Number may round. That is not a Unicode rewrite. Load sample
ageis the number 30. - Comments, trailing commas, and JSON5 are rejected by
JSON.parse. Standard JSON only (ECMA-404 / RFC 8259).
Minify JSON in the browser
Load sample Minify is the compact John Doe line. Non-ASCII stays characters. Nothing is uploaded.
Open JSON Formatter →FAQ
- What does Load sample Minify write on the live JSON page?
- Load sample fills the compact object {"name":"John Doe","age":30,"email":"john@example.com","address":{"street":"123 Main St","city":"New York","country":"USA"},"hobbies":["reading","coding","gaming"]} and does not run Prettify, Minify, or Validate. Minify then writes that same compact line. age is the number 30. The sample is ASCII — café / \u00e9 leftovers are a separate paste, not Load sample. This is not the older users / Jane Smith / total leftover. Standard JSON only — no comments, trailing commas, or JSON5.
- Does Docify’s Minify button turn café into \u00e9?
- No. The live formatter minifies with JSON.parse and then JSON.stringify with no space argument. ECMA-262 QuoteJSONString writes code points above U+001F as themselves, except quote and backslash. café, 日本語, and emoji stay as those characters. Only U+0000–U+001F, ", and \ are escaped. Load sample is the ASCII John Doe object, so that leftover does not include café. Nothing is uploaded.
- What happens to a \u00e9 escape already in the input?
- JSON.parse decodes \u00e9 to é. JSON.stringify then writes the character é, not the six-character escape. That is still valid JSON (RFC 8259 allows either form). If you need to keep every input escape spelled the same way, this parse-then-serialize path is the wrong tool. Load sample has no \u00e9 escape.
- How is this different from Python json.dumps?
- Python’s json.dumps uses ensure_ascii=True by default, so café becomes caf\u00e9. json.dumps(..., ensure_ascii=False) keeps the character. Docify does not run Python. The browser’s JSON.stringify default is the ensure_ascii=False shape for non-ASCII letters. Load sample Minify is the compact John Doe line either way, because that leftover is ASCII.