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. - Switch Formatted output to Tree to browse the parsed structure — click a node's chevron to expand or collapse it, and use the small icon buttons on each node to copy its value or its JSON Pointer path.
- While in Tree view, enter a JSON Path expression (e.g.
$.items[*].name) in the JSON Path query field that appears to highlight matching nodes in the tree.
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.
The Formatted output panel can switch between plain Text and a collapsible Tree view of the same data, and a JSON Path query box (e.g. $.items[*].name) highlights every matching node directly in that tree — both run entirely client-side against the already-validated output, so nothing you paste or query is ever sent anywhere.