LIVE Node.js + Express live batch has started. Join now and get the recordings of earlier classesNode.js batch live · join now Enroll Now
Free · No login · Runs in your browser

JSON Formatter & Validator

Paste JSON to format it, minify it or check that it is valid. Errors show the exact line and column, with a plain-English reason.

Paste JSON above, then press Format.

How to use the JSON formatter

  1. Paste your JSON into the Input box, or press Sample to try it.
  2. Press Format (or Ctrl + Enter) to beautify it with 2 spaces, 4 spaces or tabs. Minify removes all whitespace, and Sort keys orders every object A to Z.
  3. If the JSON is invalid, the status bar shows the line, the column and the reason, and the line number turns red. Click the line link to jump to the error.
  4. Press Copy to copy the result, or Edit this to move the formatted JSON back into the input.

Everything runs in your browser. Nothing you paste or type is uploaded or saved.

Frequently asked questions

How do I find the error in invalid JSON?

Press Validate or Format. The tool reports the exact line and column where parsing stopped, explains the reason in plain English (for example a trailing comma, a missing comma or a key without double quotes) and shows that line with a caret under the problem character.

Is my JSON uploaded to a server?

No. The formatter is plain JavaScript that runs in your browser. Your JSON is never sent anywhere and is not saved, so it is safe to paste API responses, tokens or customer data.

Why does my JSON with comments or single quotes show an error?

Standard JSON (RFC 8259) does not allow comments, single-quoted strings, trailing commas or unquoted keys. Those are JavaScript object syntax, not JSON. Use double quotes for every key and string value and remove comments, and JSON.parse() and every API will accept it.