JSON Formatter

Format, validate, beautify, and minify JSON.

json-formatter.local
Output
Formatted JSON will appear here.

How to use it

  1. Paste your JSON into the box.
  2. Click Beautify to indent it, or Minify to strip whitespace.
  3. Fix any error shown, then copy the result.

About this tool

The JSON formatter parses your JSON and either pretty prints it with indentation or minifies it to the smallest valid form. If the JSON is invalid, it shows the parser error message so you can find the problem. It uses the browser JSON parser, so it accepts standard JSON only, not relaxed variants with comments or trailing commas.

Examples

Input{"a":1,"b":[2,3]}
OutputIndented across multiple lines
InputPretty printed JSON
OutputMinified to one compact line

Common uses

  • Make an API response readable
  • Validate that JSON is well formed
  • Minify JSON to save space
  • Reformat config or data files

FAQ

Is my JSON sent to a server?
No. Parsing and formatting run in your browser. Your data never leaves your device.
What happens if my JSON is invalid?
The tool shows the parser error message so you can find and fix the problem.
Can I minify as well as beautify?
Yes. Beautify pretty prints with indentation, and minify strips whitespace for the smallest output.

Related tools

Embed this tool

Paste this snippet to put the tool on your own site. It runs entirely in the visitor's browser, the same as it does here.

<iframe src="https://tooldok.com/embed/json-formatter/" title="JSON Formatter by Tooldok" width="100%" height="560" style="border:1px solid #16130d;border-radius:16px;max-width:720px" loading="lazy"></iframe> <p style="font:13px sans-serif"><a href="https://tooldok.com/tools/json-formatter/" target="_blank" rel="noopener">JSON Formatter</a> by <a href="https://tooldok.com/" target="_blank" rel="noopener">Tooldok</a></p>