JSON Formatter

Prettify, minify and validate JSON with syntax highlighting and clear error messages.

Input

0 B

Press Ctrl+Enter to format.

Result

Formatted JSON appears here.

About this JSON formatter

Paste JSON, get it back readable. Formatting, minification and validation all happen in your browser using the same parser your JavaScript runtime uses, so what this page accepts is exactly what JSON.parse accepts — nothing is uploaded or logged.

Format, minify, validate

  • Format re-indents with 2 spaces, 4 spaces or tabs, optionally sorting object keys so two payloads can be diffed cleanly.
  • Minify strips every insignificant byte — useful before embedding JSON in a config value or measuring a real payload size.
  • Validate checks the document without changing it, and points at the exact line and column that broke.

Common JSON errors

Most invalid JSON comes down to a handful of causes: a trailing comma after the last item, single quotes instead of double quotes, unquoted object keys, a stray comment, or NaN/undefined where a real value belongs. JSON permits none of these, even though JavaScript object literals do.

Is my data safe?

Yes. There is no server involved in the formatting — you can open your network tab and confirm nothing is sent. Once the page has loaded it works offline, which makes it safe to use with production payloads, API responses and anything containing customer data.