它到底是什么
接口返回解析失败时,报错往往只说「格式不对」。原条目说这个工具会给出具体行号,并顺带美化或压扁文本。
怎么用
把 JSON 贴进去点校验,看它指出的行列,改完再验一次;需要提交时切到压缩模式。
免费档给到哪
免注册、浏览器内运行。
强在哪、弱在哪
定位语法错极快;但它只管语法,字段名写错、值类型不对这类语义问题它看不出来。
适合谁
调接口、拼配置、排查多余逗号或引号的开发者。
常见问题
能查出字段名拼错吗?
不能,那是语义问题,需要 schema 校验。
会上传数据吗?
原条目写明在浏览器里完成。
为什么提示行号和我编辑器不一样?
多半是贴进来时多了空行或 BOM,先原样复制再验。
关于原文与更新
本页中文部分按中文习惯重写,只转述原条目已有的事实,不新增功能承诺。下面是原站评测全文,一字未删照搬,便于逐条核对;第三方服务的功能与免费额度会变,以英文原条目和对方官网为准。
原站评测全文(英文原文,照搬)
JSONLint
JSONLint is the fastest way to find out why your JSON will not parse. Paste it in, and instead of a vague error from your application you get the specific line and character where the syntax breaks.
What It Is
JSON syntax errors are notoriously annoying because the failure message from a parser is often useless — "unexpected token" without telling you where. JSONLint points at the exact position and usually describes what it expected instead.
It catches the mistakes that actually happen in practice: trailing commas after the last array element, single quotes instead of double, unescaped characters inside strings, comments (which JSON does not permit), and mismatched brackets.
Once valid, you can pretty-print with proper indentation or minify to a single line for shipping. It runs in the browser with no registration.
How To Use It
- Go to jsonlint.com
- Paste your JSON into the editor, or load it from a URL.
- Click Validate. If it fails, read the reported line number and error description.
- Fix the issue — trailing commas, quote style and unescaped characters are the usual culprits.
- Re-validate, then copy the pretty-printed or minified output.
Free Plan Details
| Registration | Not required |
|---|---|
| Watermark | None |
| Cost | Free |
| Functions | Validate, format/pretty-print, minify |
| Error reporting | Exact line and position with description |
| Input | Paste, upload or load from URL |
| Processing | Browser-side |
Check before you rely on it: free quotas, file limits and pricing change frequently. Confirm current terms on the official site before depending on it for regular work.
Strengths And Limitations
What works well
- Pinpoints the exact line of a syntax error
- Catches the mistakes that actually occur: trailing commas, quote style, unescaped characters
- Pretty-print and minify in one place
- No registration, works immediately
- Fast even on large documents
Limitations
- Validation only — it does not check your JSON against a schema
- No comparison or diff between two documents
- Very large files can be slow to render
- No saved history without an account
Who Should Use It
Developers debugging API responses, anyone hand-writing config files, and students learning JSON syntax. If a JSON file refuses to load, this is the first place to paste it.
Frequently Asked Questions
Is JSONLint free?
Yes, validation and formatting are free with no registration required.
Does it tell me where the error is?
Yes — it reports the line and position of the syntax error along with a description of what it expected.
What errors does it catch?
Trailing commas, single quotes, unescaped characters, comments, mismatched brackets and other invalid syntax.
Can it minify JSON?
Yes, it can both pretty-print with indentation and minify to a single line.
Does it validate against a schema?
No, it checks syntax only. Schema validation needs a different tool.
Is my data uploaded?
Validation runs in the browser, but avoid pasting sensitive credentials into any online tool as a habit.