{ } Format · Minify · Validate · Convert

JSON 工具

A single place to format, minify and validate JSON, plus convert between JSON and CSV. Everything runs in your browser — no upload.

Input

Output

A complete JSON workbench in your browser

JSON is everywhere — API responses, config files, NoSQL exports, log entries. This page bundles the operations developers and analysts need every day:

格式化 (pretty-print)

Turn a one-line minified blob or messy hand-written JSON into a clean, indented document. Choose 2 spaces, 4 spaces or a real tab character. Useful for reading API responses, sharing snippets in bug reports, or pasting into documentation.

压缩

Strip every unnecessary character from JSON to ship the smallest possible payload. Typical savings are 20-40% on real-world data; on heavily indented configs the savings can hit 60%. The status bar shows the exact byte difference and percent saved.

验证

Verify your JSON parses cleanly. On error, we display the engine's message plus a guessed line and column number with a 2-line snippet showing exactly where parsing broke. This works even in browsers and runtimes that no longer include positions in error messages — we figure it out ourselves.

JSON ↔ CSV

Convert an array of objects to CSV with one click. Nested objects are flattened with dot-notation (so {"user":{"name":"Alice"}} becomes a column user.name). Nested arrays are serialized as JSON strings inside their cells. Rows with different keys produce the union of all columns — missing fields become empty cells. The CSV → JSON direction handles quoted fields, embedded commas, and escaped quotes correctly (we use the battle-tested PapaParse library).

隐私

Everything runs locally. Your JSON, your CSV, your secrets — none of it leaves the browser tab. The only network request is the one-time CDN load of PapaParse. We don't even see file sizes.

常见使用场景

常见问题

如何在线格式化 JSON?
将 JSON 粘贴到输入框中并点击格式化。工具会立即使用您选择的缩进(2 空格、4 空格或制表符)美化打印。一切都在浏览器中运行——没有数据上传到任何服务器。
这个 JSON 工具会将我的数据上传到服务器吗?
不会。所有格式化、压缩、验证和转换都完全在您的浏览器选项卡中使用 JavaScript 进行。您的 JSON 永远不会离开设备。唯一的网络请求是一次性的 PapaParse 库 CDN 加载(用于 CSV 转换)。
可以将 JSON 转换为 CSV 和 CSV 转换为 JSON 吗?
可以。点击「JSON 转 CSV」将对象数组转换为可下载的 CSV 文件。嵌套对象使用点号表示法展平。反向操作时,粘贴 CSV 数据并点击「CSV 转 JSON」——它使用 PapaParse 库正确处理引号字段、嵌入逗号和转义引号。
当 JSON 有语法错误时会怎样?
验证功能会检测语法错误,并显示解析失败的确切行号和列号,以及 2 行代码片段。即使在不再包含位置信息的环境中,我们的工具也会独立计算。
JSON 工具免费吗?有使用限制吗?
完全免费,没有使用限制或数据大小限制。处理完全在客户端进行,因此唯一的限制是浏览器内存。测试表明可以处理超过 10 MB 的 JSON 文件。

相关工具