JSON Formatter & Validator
Format, validate and minify JSON with precise error positions
About this tool
Paste any JSON — an API response, a config file, a log line — and this formatter pretty-prints it with your choice of indentation, or minifies it for embedding. Parsing uses the browser's native JSON engine, so what validates here is exactly what JavaScript and every JSON-compliant parser will accept.
When the input is invalid, the error is annotated with the exact line and column where parsing failed, instead of a vague "unexpected token" somewhere. Combined with the monospaced editor, hunting a missing comma in a 500-line payload becomes a ten-second job. You can also sort object keys alphabetically, which helps before diffing two payloads.
Formatting runs entirely in your browser. Payloads containing tokens, customer records or internal URLs never leave your machine — there is no server that could log them.
Frequently asked questions
- Why does my JSON fail with "Unexpected token" even though it looks fine?
- The usual culprits are trailing commas after the last item, single quotes instead of double quotes, unquoted keys, or comments. All of these are fine in JavaScript object literals (or JSON5) but not in strict JSON. The line/column marker points at the first offending character.
- Is there a size limit?
- No hard limit — parsing is local, so it depends on your machine. Documents up to tens of megabytes format fine in a modern browser; beyond that the tab may slow down because the whole document is held in memory.
- Does formatting change my data?
- Only whitespace, unless you enable key sorting. Numbers are re-serialized by the JavaScript engine, so 1e2 becomes 100 and integers beyond IEEE-754 double precision are normalized — the same thing any JS-based consumer of your JSON would do.
- Can I validate JSON without reformatting it?
- Yes — the status badge above the input updates as you type and reports whether the document parses, its size, and where the first error is. You only need the Format action when you want the output rewritten.