JSON Formatter
Format, minify and validate JSON — with the exact line and column of every error, sorted keys, a collapsible tree view, JSONPath queries, a document comparison and basic YAML conversion. Nothing leaves your browser; no data is uploaded or stored.
Your JSON
Enter some JSON.
Result
Paste JSON and press Format, Minify or Validate.
How this tool works
Format. Pretty-prints valid JSON with 2- or 4-space indentation, without changing any value. Minify squeezes it to one line, and the minified text parses back to the same data.
Errors. Invalid JSON is reported with the exact line, column and reason, plus the offending line with a pointer under the bad character. Duplicate keys in the same object are flagged.
Tree. The tree view renders objects and arrays as collapsible sections, so a large document can be explored a branch at a time.
JSONPath. Query with a path like $.tags[0] or $.user.name; * matches every value of an object or array. A path without $ is read as $.path.
Compare. Two documents are walked together and every difference is listed by path — changed values, missing keys and type changes.
YAML. A basic conversion: objects become key: value lines, arrays become - item lines, and strings that would be misread are quoted.
Privacy. Parsing and processing happen entirely in your browser. Nothing is uploaded, stored or shared.
Limits. Inputs over 1 MB show a warning; very large JSON (over 5 MB) may be slow.