Skip to content
Tools

JSON Formatter & Validator

Beautify, minify and validate JSON with clear error messages.

Local
Result

What this tool does

The JSON Formatter reads the JSON you paste in, checks that it is valid, and prints it back either beautified with consistent indentation or minified to the smallest valid form. When the input is not valid JSON, it points you at the first syntax error with its line and column so you can fix it quickly.

How to use it

  1. Paste or type your JSON into the input panel, or import a .json file.
  2. Pick an indent width (2 spaces, 4 spaces or a tab).
  3. Press Format to beautify, or Minify to compact.
  4. Copy the result or download it as a file.

Formatting runs as you type, so the status line tells you straight away whether the input is valid.

Common use cases

  • Making an API response readable before you inspect it.
  • Spotting a trailing comma or missing bracket in a config file.
  • Minifying a payload before pasting it into a test fixture.
  • Normalising indentation so two JSON files diff cleanly.

Good to know

JSON does not allow comments, trailing commas or single-quoted strings. If your input uses any of those, the validator will flag it. Numbers keep their value but not their original formatting, so 1.0 becomes 1 and leading zeros are not preserved, because the tool parses the input into real values and re-serialises them.

Frequently asked questions

Is my JSON sent to a server?
No. Formatting and validation run entirely in your browser. Your input never leaves the page.
What does the validator check?
It parses your input with the browser JSON parser and reports the first syntax error with its position, so you can jump straight to the problem.
Can it fix invalid JSON?
This tool validates and reformats valid JSON. It points you at syntax errors rather than guessing at repairs, so you stay in control of the result.

Learning resources

Testsmith also runs hands-on courses and a free practice app for the skills behind this tool.

Feedback welcome

Found a bug in this tool, or want it to do something it does not? Tell us and we will take a look.