This site contains affiliate links.

JSON Formatter

Pretty-print, validate and minify JSON in your browser

Paste an API response or config file to make it readable and check it for errors.

Loading...

Paste JSON to format it with 2- or 4-space indentation or minify it, with the syntax error shown when parsing fails. For debugging API responses, reading config files and cleaning up log output. The JSON you paste is not sent to any server.

JSON Formatter: tips and things to know

  • JSON requires double quotes around keys and strings; single quotes are invalid.
  • A trailing comma after the last item is an error in JSON.
  • Nesting depth is limited only by the parser; hundreds of levels are fine.
  • Numbers longer than about 16 digits are rounded, and only the last of any duplicate keys is kept.

How to use the JSON Formatter

  1. Paste your JSON

    Paste the text into the input box.

  2. See it formatted

    The formatted result appears instantly. If the JSON cannot be parsed, the browser's error message is shown in red; most browsers include the position of the problem.

  3. Copy or minify

    Copy the result, or press Minify to compress it.

JSON Formatter FAQ

Is my JSON sent to a server?

No. Everything is processed in your browser.

Can it handle large files?

Anything that fits in browser memory. Files of a few megabytes format without trouble.

What does Minify do?

It removes indentation and line breaks to make the JSON as small as possible, for example for an API request body.