JSON Formatter and Validator

Format, validate and minify JSON, with clear error messages.

Output

 

Use this tool on EWD Labs

This copy of the tool can't run here. Open the original, free version instead.

Open JSON Formatter

Runs in your browser. Nothing you type is uploaded.

How to use the JSON formatter

  1. Paste your JSON into the box, or press Try an example.
  2. Choose 2 spaces, 4 spaces, tabs or minified output.
  3. Tick Sort keys A to Z to put every object's keys in order, which makes two JSON files easy to compare.

The JSON is checked as you type. If it isn't valid, you see the line and column of the first problem.

Common JSON mistakes

  • Single quotes. JSON needs double quotes around keys and text: {"name": "Asha"}.
  • A comma after the last item: [1, 2, 3,] is not allowed.
  • Keys without quotes: {name: "Asha"} is JavaScript, not JSON.
  • Comments. JSON has no comments, so remove // and /* */ lines.

Your JSON never leaves your browser, so it is safe to format API responses and config files that hold private data.

Frequently asked questions

Is my JSON uploaded anywhere?

No. Formatting and checking happen in your browser, so it is safe to paste API responses and config files.

Why does it say my JSON is invalid?

The message shows the line and column of the first problem. The usual causes are single quotes, keys without quotes, a comma after the last item, or comments.

What does Sort keys do?

It puts every object's keys in A to Z order. That makes two JSON files much easier to compare.

How big a file can it format?

Several megabytes work fine in a modern browser. Very large files may take a moment.