JSON 压缩工具
先校验后压缩,杜绝产出损坏文件;仅移除字符串外的空白,显示前后字节数对比。
How it works
The input is parsed then re-serialized with JSON.stringify, which guarantees the result is still valid JSON — blind regex stripping can corrupt string contents. Minification removes line breaks, indentation and spaces around separators. Keep a formatted copy of config files somewhere safe; minified output is meant for transfer and storage.
如何使用JSON 压缩工具
粘贴带格式的 JSON,输出压缩后的单行版本与精确的前后字节对比。压缩前先做完整校验,畸形输入会被带着位置拒绝,绝产出一个看起来正常实则损坏的文件。
移除的只有字符串外的空白——键名、字符串内容、数值逐字节保留,典型格式化 payload 缩水三到六成。版本库里留格式化源文件,构建或部署时再压缩,这个工具负责的是部署那一半。