JSON Formatter

Put a JSON string in the JSON box and click Format. Valid input is parsed then re-serialized with two-space indentation. Invalid input shows Invalid JSON plus the parser message instead of pretty output.

Updated 2026-08-03 · developer

Click Format.

About this tool

Format runs JSON.parse on the textarea, then JSON.stringify with a null replacer and indent 2. The result area starts with Click Format and updates only when you press the button—so you can edit freely before committing a format pass.

How to use

  1. Paste JSON: Enter or paste your JSON into the JSON textarea.
  2. Click Format: Press Format to parse and pretty-print with two-space indent.
  3. Read the result: Use the indented output, or read the Invalid JSON error if parsing failed.
  4. Fix and retry: Correct syntax problems in the JSON box, then click Format again.

Common use cases

Tips

FAQ

How much indentation is used?

Successful formatting uses two spaces per level via JSON.stringify indent 2.

What happens on bad JSON?

The result shows Invalid JSON followed by the error message from the parser.

Does Format run automatically?

No. You must click Format; typing alone leaves the previous result unchanged.

Is my JSON sent anywhere?

No. Parsing and stringifying happen in the browser on this page.

Related keywords

Related tools