JSON Formatter & Validator
Pretty-print, minify, sort keys and pinpoint syntax errors by line and column.
Paste JSON and press Format, or use Ctrl/⌘ + Enter.
What this tool does
It parses your text with the browser's built-in JSON parser, then re-serialises it with the indentation you choose. Minify removes all optional whitespace to produce the smallest valid output. Sort keys orders object keys alphabetically at every level, which makes two documents easy to compare.
Common JSON errors
- Trailing commas after the last item in an object or array.
- Single quotes instead of double quotes around strings and keys.
- Unquoted keys, comments, or JavaScript values such as undefined and NaN.
- Unescaped control characters or line breaks inside strings.
Privacy
Nothing you paste leaves your browser. There is no server component, so the tool keeps working if you lose your connection after the page has loaded.