Online JSON Minifier, Escape & Unescape Tool
Free online JSON minifier, escape, and unescape tool. Compress JSON to one line, strip backslash escapes from logs, and inspect byte savings locally.
What Minifying Long JSON and Unescaping Solves
In daily development, JSON constantly moves between two forms: "human-readable" and "machine-compact for transport":
- Minify to one line (JSON Minify): compress an indented, multi-line config file into a single line so it fits into
.envenvironment variables,curl -drequest bodies, Nginx/CI variables, or to reduce storage size, while showing the byte reduction ratio in real time. - Minify and escape (JSON Escape): automatically escape double quotes as
\"and wrap the result as a valid string literal, so it can be embedded directly in Java, Go, Python, SQL, or a nested JSON field. - Remove backslash escapes (JSON Unescape): JSON copied from Kibana, ELK, cloud functions, or terminal logs is often full of
\"and\n. One click on "Unescape and Expand" restores it to clean, indented JSON you can inspect.
Typical Example
An escaped log fragment:
"{\"userId\":42,\"status\":\"ok\",\"msg\":\"done\"}"
After clicking "Unescape and Expand", it is restored to standard JSON. If you need to dig into field differences, continue with the JSON Diff & Compare or go back to JSON Formatter & Beautifier for a syntax check.
Notes
- Minifying and escaping strictly follow standard JSON syntax; if the input contains single quotes or a trailing comma, the exact error location is reported.
- All processing happens locally in your browser, so config secrets and business logs are never sent to a server.
Frequently Asked Questions
Does minifying JSON to one line remove spaces inside strings?
No. The tool first parses with JSON.parse and re-serializes without indentation, so it only removes indentation and line breaks between structures. Spaces inside string values are fully preserved.
How do I quickly remove backslashes from {\"code\":200} copied from logs?
Paste it into the input and click "Unescape and Expand". The tool automatically restores the backslash-escaped double quotes and formats them into readable standard JSON.
When do I need "Minify and Escape"?
When you need to put a piece of JSON into an environment variable, a Docker/Shell command, a SQL string, or a string field of another JSON layer, minifying and escaping first avoids quote conflicts.