Format and validate JSON

Beautify, minify and validate JSON, with clear error messages pointing to the exact line and character causing the problem.

Your JSON

Paste it below

Result

The formatted JSON will appear here.
🎯

Built for one job

Each tool does a single thing properly, with the settings that job actually needs.

⚡

Finishes in seconds

No queue and no waiting around — most jobs are done before you look away.

🆓

Free and unlimited

No sign-up, no credits, no watermark on anything you download.

How to format and validate json

  1. 1

    Paste your JSON

    Drop in anything from an API response to a config file, however badly formatted.

  2. 2

    Format or minify

    Format to read it, minify to ship it. Invalid JSON is reported with the line and character to fix.

  3. 3

    Copy the result

    Take the cleaned-up JSON straight to your editor.

Frequently asked questions

What does formatting actually change?

Only the whitespace. The document is parsed into values and written back out with consistent indentation, so the data is identical — the same keys, the same values, the same nesting. Formatting cannot alter what your JSON means, which is why it is safe to run on anything.

When should I minify instead?

When the JSON is going over a network or into a file that nothing human will read: API payloads, configuration bundled into a build, data embedded in a page. Stripping the whitespace typically removes a fifth of the size on nested data, and gzip narrows that gap further, so minifying matters most where every byte is paid for repeatedly.

Why does it say my JSON is invalid when it looks fine?

Almost always one of four things: a trailing comma after the last item, single quotes where JSON requires double, property names left unquoted, or a stray comment. All four are legal in JavaScript and none are legal in JSON, which is exactly why they are so easy to write by accident.

Does the order of keys change?

No. Keys are written back in the order they were parsed, so a formatted document reads in the same sequence as the original. JSON itself does not guarantee object key order, but nothing here reorders them.

Can it handle a large file?

A few megabytes is comfortable. Beyond that the browser has to hold the text, the parsed structure and the formatted output at once, so a very large export is better handled by a command-line tool such as jq.

Related tools