Skip to content
SnapTools

JSON Formatter

Runs in your browser

Format, validate and minify JSON. Paste minified or messy JSON and get readable, indented output — or strip it back down to the smallest valid form. Syntax errors are reported with the exact position.

Formatted JSON will appear here...

About this tool

JSON (JavaScript Object Notation) is a common format for storing and exchanging data. Minified JSON has no line breaks or spaces, which saves size but is hard to read. This tool adds indentation and line breaks so you can inspect and edit JSON easily, validates your input, and reports the precise syntax error when parsing fails. Minify does the reverse: it removes every unnecessary byte for production payloads.

How to use

  1. Paste your JSON string into the input box (e.g. from an API response or config file).
  2. Click Format to pretty-print the JSON with two-space indentation.
  3. Click Minify to strip all whitespace for the smallest valid output.
  4. If the input is invalid, the exact parser error is shown so you can locate the problem.
  5. Copy the result for use in your project or documentation.

When to use this tool

  • Reading minified API responses or config files.
  • Preparing JSON for documentation or code reviews.
  • Debugging malformed JSON by seeing structure clearly.
  • Shrinking a config payload before shipping it to production.
  • Converting one-line JSON logs into readable form.

Tips

  • Valid JSON requires double quotes for keys and strings; single quotes are not allowed.
  • Trailing commas in arrays or objects make JSON invalid—remove them before formatting.
  • Minify is safe to run on already-formatted JSON: the parsed value is identical, only the whitespace changes.

FAQ

Why does it say Invalid JSON?
Usually due to trailing commas, single quotes instead of double, or unescaped characters in strings. The error message shows the exact character position where parsing failed.
Is my JSON sent to your server?
No. Formatting, validation and minification all run in your browser using the native JSON parser. Your data never leaves your device.
What is the difference between format and minify?
Format adds indentation and line breaks for human readability. Minify removes all optional whitespace to produce the smallest valid JSON. Both produce the same parsed value.