Skip to content

Free tool

JSON Formatter & Validator

Paste JSON to pretty-print, minify or validate it. Errors show the exact line and column.

Runs entirely in your browser. Nothing you enter is sent to a server.

Result

Paste JSON on the left.

How it works

The tool first checks your text against the JSON grammar (RFC 8259) with its own parser, so the error position is the same in every browser. If the text is valid it is parsed with JSON.parse and written back with JSON.stringify using the indentation you choose, or with no whitespace for minify.

Validation happens as you type. All processing is local and instant for typical documents, though very large files may take a moment.

Common uses

  • Reading a minified API response or log line.
  • Finding the missing comma or stray quote in a config file.
  • Minifying a payload before embedding it in code or a request.
  • Sorting keys so two JSON files can be compared with a text diff.

Frequently asked questions

Is my JSON uploaded anywhere?

No. Formatting and validation run in your browser with JavaScript. The text you paste is never sent to Soch Tech or any other server.

Why does my JSON fail when it works in JavaScript code?

JSON is stricter than JavaScript object syntax. Property names and strings need double quotes, trailing commas are not allowed, and comments, undefined and single quotes are not valid JSON.

What do the line and column numbers mean?

They point to the first character where the text stops being valid JSON. The real mistake is sometimes just before it, for example a missing comma at the end of the previous line.

Does formatting change my data?

Formatting only changes whitespace. If you enable "Sort keys" the order of object properties changes, which is harmless for most uses but is a change. Very large integers can lose precision when re-serialised by JavaScript, so check those separately.

All free tools

Need something built?

Turn this into a real product with Soch Tech

These tools are free to use. If you need custom software, a database or a secure application, tell us what you are working on.