在浏览器中压缩并校验 JSON,并查看你节省了多少字节。
如何使用 JSON 压缩
粘贴你的 JSON。
它会自动被校验并压缩。
复制压缩后的输出并查看节省的字节。
A JSON minifier validates your JSON and strips out every unnecessary character, the spaces, indentation and line breaks that make JSON readable, then reports how many bytes and what percentage you saved.
Minified JSON is identical in meaning to the formatted version; only the cosmetic whitespace is gone. That makes it the right form for production: API responses, config bundled into an app, or any payload where transfer size and parse time matter.
It runs in your browser using the native JSON engine, so the output is exactly what your own code would produce. Because it parses first, a successful minify also confirms your JSON is valid; invalid input returns a precise error instead.
One subtle effect is number normalization, which is part of the JSON standard rather than this tool: 1.50 becomes 1.5 and 1e3 may be rewritten, because those represent the same value. Keys, strings, booleans and structure are never changed.
Minification and gzip are complementary, not alternatives. Servers usually gzip responses, which compresses repeated text heavily; minifying first removes whitespace the compressor would otherwise have to handle, and the two together give the smallest transfer.
When you need to read or edit JSON instead of shrink it, the JSON Formatter does the reverse, pretty-printing it with clean indentation. Nothing you paste here is uploaded.
常见问题
它移除所有不必要的空白和换行,生成数据相同、体积最小的有效 JSON,传输更快。
不会。只移除格式。键、值和类型都会保留,数字按 JSON 标准规范化(例如 1.50 变为 1.5)。
你会看到解析器的错误信息以便修复。在 JSON 有效之前不会进行压缩。
嵌入此工具
将此工具添加到你自己的网站。复制下方代码片段即可,它会自动保持最新。
<iframe src="https://monu.tools/embed/zh/json-minifier" width="100%" height="640" style="border:1px solid #e5e5e5;border-radius:12px;max-width:680px" loading="lazy" title="Monu Tools"></iframe>相关工具