JSON Formatter

Format, validate and minify JSON online with pinpoint error locations and one-click auto-repair for trailing commas, comments and unquoted keys. Sort keys, see depth & size. Free, private, in-browser.

How to use the JSON Formatter

  1. 1

    Paste your JSON into the box.

  2. 2

    Click Beautify to pretty-print, or Minify to compact it.

  3. 3

    If it's invalid, click Auto-repair to fix trailing commas, comments and quotes.

  4. 4

    Use Sort keys to order alphabetically, then Copy or Download the result.

Frequently asked questions

What does Auto-repair fix?

Common mistakes JSON.parse rejects: trailing commas, // and /* */ comments, single quotes, and unquoted object keys.

Where do errors show?

Invalid JSON reports the exact line and column so you can jump straight to the problem.

Is my data safe?

Yes — everything runs locally in your browser. Your JSON is never uploaded.

Tips & discussion

Share a trick, ask a question, or help others get more out of this tool.

Log in to share a tip or ask a question.

Loading tips…