Something wrong with this tool?
About JSON Formatter Online
This tool formats and minifies JSON documents. In pretty-print mode it adds structured indentation and line breaks to make deeply nested objects readable. In minify mode it strips all whitespace to produce the most compact representation for network payloads and storage.
Extra options include sorting object keys alphabetically — useful for producing stable output that diffs cleanly in version control — and adding a trailing newline for editors and formatters that require one.
The formatter validates JSON structure server-side before returning output. If your input is syntactically invalid, the tool returns a clear error message with position information to help you locate the problem.
How to use this tool
How to format or minify JSON
Paste your JSON
Paste any JSON text — an object, array, or primitive — into the JSON field. The tool validates the structure on the server and returns an error message if the input is not valid JSON.
Choose output mode
Select Pretty-print to add indentation and line breaks so the structure is human-readable, or Minify to remove all unnecessary whitespace and produce a compact single-line payload. The default is pretty-print.
Adjust indent and options (pretty only)
For pretty-print, set the indent to 2, 4, or 8 spaces, or use tabs. Optionally enable Sort object keys to produce alphabetically stable output (useful for diffs), or enable Trailing newline for tools that require it.
Run and copy the result
Press Run. The formatted or minified JSON appears in the output area. Click Copy to grab the result. If you need a file, paste into a text editor and save as .json.