墨工坊

DEV NO.001

JSON 格式化与校验

粘贴任意 JSON,即时格式化、压缩、校验并高亮错误位置。

此工具完全在本地运行,数据不会上传到任何服务器。

输入
输出

这是什么

什么是 JSON 格式化工具

JSON 是现代 Web 的通用数据格式,但接口返回的 JSON 常常被压缩成一行,难以阅读和调试。本工具粘贴即得:格式化(美化缩进)、压缩(移除空白)、校验(定位第一个语法错误的行号与列号)三种模式一键切换。

What is a JSON formatter

A JSON formatter turns minified machine output into readable, structured text. This tool runs three modes — beautify, minify and validate — locally in your browser. Errors are reported with exact line and column numbers so you can fix them immediately.

如何使用

  1. 在输入框粘贴 JSON 文本(或点击「示例」载入样例)。
  2. 点击「格式化」或「压缩」,结果实时显示在输出框。
  3. 点击「复制」带走结果;出现红色错误提示时,按行号修复原文。

How to use

  1. Paste JSON into the input box (or load the sample).
  2. Click Format or Minify; the result appears instantly.
  3. Hit Copy to take the result. If a red error appears, fix the reported line and try again.

常见问题

我的 JSON 数据会被上传吗?

不会。格式化与校验完全在浏览器中执行,数据只存在于你的设备内存里。

支持多大的 JSON?

通常数 MB 以内都能流畅处理。若浏览器出现卡顿,建议先压缩不必要的字段。

错误提示为什么显示某个行列号?

校验器会给出第一个语法错误的行号与列号,例如缺少逗号或多余的引号,直接跳转修复即可。