JSON Formatter & Validator — Beautify or Minify JSON Online
Format, validate and minify JSON with error messages that point at the exact line.
🔒 Runs in your browser — files never uploaded ⚡ No signup 💯 Free
Input and output stack vertically on small screens.
Paste raw JSON and get it back readable, with the syntax error pinned to a line and column if it will not parse. Minify in the same click when you need the smallest possible payload.
Everything runs in your browser, so API responses containing tokens or customer data never leave your machine.
How to use JSON Formatter
- Paste your JSON into the left pane. It validates as you type.
- Choose your indentation — 2 spaces, 4 spaces, tabs, or minified.
- Sort keys alphabetically if you are diffing two payloads and want a stable order.
- Copy or download the result.
Reading the error messages
When JSON fails to parse, the browser reports a character offset that is useless on a long payload. We convert that into a line and column and print the offending line with a caret underneath it.
The usual culprits: a trailing comma after the last item (legal in JavaScript, illegal in JSON), single quotes instead of double, unquoted keys, or a stray newline inside a string. JSON has no comments — if your file has // lines it is JSON5 or JSONC, not JSON.
Sorting keys
Object key order carries no meaning in JSON, so sorting alphabetically is safe and makes two payloads directly comparable in a diff tool. Array order is meaningful and is never touched.
Frequently asked questions
Is my JSON sent to your server?
No. Parsing and formatting happen entirely in your browser using the built-in JSON engine. This is safe for API responses containing tokens, keys or customer data.
Why does my JSON say "unexpected token"?
The usual causes are a trailing comma after the last item, single quotes instead of double quotes, unquoted object keys, or comments. JSON allows none of these. We show the exact line and column so you can find it quickly.
What is the largest file I can format?
There is no hard limit, but browsers start to slow noticeably past a few megabytes. For very large payloads use a command-line tool like jq.
Does sorting keys change my data?
No. Object key order is not meaningful in JSON, so sorting is safe and makes two payloads comparable in a diff. Array order is meaningful and is never changed.