Dev Converters
JSON & YAML

JSON Formatter & Validator

Pretty-print, validate, and minify JSON online. Syntax errors are surfaced with a clear line and column. Fully offline, no upload.

How it works

JSON validation and formatting is the single most common operation a backend developer runs during debugging. Whether the payload comes from a log file, a `curl -v` dump, or a DevTools Network tab, humans read it far more easily when indented. Even more importantly, if the JSON is malformed, you want the exact line and column of the error, not a vague "Unexpected token".

This formatter parses the input with the native `JSON.parse` and re-serialises with `JSON.stringify(value, null, 2)`. The two-space indent is the universal convention for JSON (tabs in JSON are legal but cause diff churn and render inconsistently). Minify mode (triggered by the `minify:` prefix or the UI toggle) drops all whitespace, useful when shaving bytes off an API response or embedding JSON in a URL.

If the parser rejects your input, check these common issues: trailing commas (JSON forbids them, unlike JavaScript object literals), single quotes around keys (must be double quotes), unquoted keys (must be quoted strings), missing commas between array elements, or smart quotes from a word processor. The error message from V8 includes a character position that lines up with your pasted input.

Frequently asked questions

Can this minify JSON as well?
Yes. Prefix your input with `minify:` to get a single-line minified version instead of the pretty-printed one.
Does it handle JSON with comments (JSONC)?
No. Strict JSON (RFC 8259) does not permit comments. Strip them before pasting, or use a JSON5 parser instead.
What indent level does the formatter use?
2 spaces. This matches the overwhelming convention for config files, package.json, and API payloads.

Related tools