JSON Formatter & Validator
Paste JSON to validate it and instantly reformat or minify it.
How to use the JSON Formatter & Validator
- Paste any JSON into the JSON input box.
- Choose an indent style — 2 spaces, 4 spaces, Tab — or Minify to compact it.
- The formatted result appears automatically a moment after you stop typing.
- If the JSON is invalid, the exact line and column of the problem is shown next to the options.
- Copy the result to your clipboard, or download it directly as a
.jsonfile.
How This Tool Works
The JSON Formatter & Validator scans your input with a hand-written parser that follows the JSON specification exactly, so it can point to the precise line and column where something goes wrong — instead of relying on your browser's own error message, which varies between browsers.
Once your JSON is confirmed valid, it's re-serialized with your chosen indentation (2 spaces, 4 spaces, or a tab) or compacted into a single minified line. Nothing you paste is ever sent to a server — formatting happens entirely in your browser.