在线格式化、美化和校验 JSON,对无效输入给出清晰的错误提示。
如何使用 JSON 格式化
将你的 JSON 粘贴或输入到输入面板。
点击 Run 解析并以 2 个空格缩进重新打印。
复制格式化后的 JSON,如果输入无效则查看错误信息。
The JSON Formatter and Validator turns minified, escaped or messy JSON into a clean, indented structure you can actually read, and pinpoints syntax errors with their exact location so you can fix them fast.
It runs your input through a strict JSON parser. If parsing succeeds, the tool re-prints the data with a consistent 2-space indent, which means a clean format is also proof that your JSON is valid. If parsing fails, you get a precise error instead of a vague "something is wrong".
Developers reach for it constantly: inspecting an API response, sanity-checking a config file, cleaning up a webhook payload before saving it, or making a large blob diff-friendly before committing it to version control. Readable JSON makes structure, nesting and missing fields obvious at a glance.
Most "invalid JSON" errors come from a handful of causes: keys or strings wrapped in single quotes instead of double quotes, a trailing comma after the last item, comments (which standard JSON does not allow), unquoted keys copied from a JavaScript object, or smart quotes pasted in from a document. The error position tells you exactly where the parser gave up.
Because the whole thing runs in your browser, your JSON never leaves your device. That matters when the payload contains access tokens, customer records or anything you would not want to paste into a random website that quietly uploads it to a server.
Once formatted, copy the result with one click. If you need the opposite, the JSON Minifier strips all whitespace to produce the smallest possible payload for production.
常见问题
它会解析你的 JSON,检查其是否有效,并以整洁的 2 空格缩进重新打印,便于阅读。无效的 JSON 则会返回精确的错误信息。
不会。你的 JSON 完全在浏览器中格式化,因此不会向服务器发送任何内容。不会被存储、记录或分享。
格式化工具遵循严格的 JSON 标准:键和字符串需使用双引号,不允许尾随逗号和注释。错误信息会显示解析失败的位置。
嵌入此工具
将此工具添加到你自己的网站。复制下方代码片段即可,它会自动保持最新。
<iframe src="https://monu.tools/embed/zh/json-formatter" width="100%" height="640" style="border:1px solid #e5e5e5;border-radius:12px;max-width:680px" loading="lazy" title="Monu Tools"></iframe>相关工具