Format messy JSON with consistent indentation, minify it back to one line, and get exact error positions when something is broken — "line 3, column 14" instead of a vague parse failure.
Formatting and validation happen entirely in your browser. The error scanner is a structural parser of its own, so it can pinpoint the first mistake in objects, arrays, strings, numbers and literals even when the browser's own message cannot.
Frequently asked questions
Is my JSON sent to a server?
No. Parsing, formatting and error detection all run locally in your browser — safe for private data.
Why does my JSON fail on trailing commas?
The JSON standard does not allow a comma before } or ] — that is a JavaScript-only convenience.
What indent does the formatter use?
Two spaces, the most common convention for config files and API responses.
中文说明
把杂乱的 JSON 排版成统一缩进、或压缩成一行,并在格式有错时给出精确位置——"第 3 行第 14 列",而不是含糊的解析失败。
格式化与校验完全在浏览器本地完成。错误扫描器是独立的结构解析器,即使浏览器自身的报错不含位置,它也能定位对象、数组、字符串、数字和字面量中的第一处错误。
常见问题
我的 JSON 会上传到服务器吗?
不会。解析、格式化和错误检测全部在浏览器本地运行,敏感数据也安全。
为什么尾逗号会报错?
JSON 标准不允许 } 或 ] 前出现逗号——那是 JavaScript 的特有语法。
格式化用几个空格缩进?
两个空格,这是配置文件和 API 响应最常见的约定。