JSON Formatter

Pretty-print, minify, or sort-keys on a JSON document.

Monitor this automatically

NetTests can run this check on a schedule, preserve historical results, compare changes over time, and alert you the moment something breaks.

Start monitoring free → See all monitoring products

Frequently Asked Questions

What does this tool do?

It parses JSON text and lets you pretty-print it with indentation (making it human-readable), minify it (removing all whitespace for smaller payloads), or sort all object keys alphabetically (useful for diffing two JSON objects).

Why is my JSON invalid?

Common causes: trailing commas after the last item in an object or array (not allowed in JSON, only in JavaScript); single-quoted strings (JSON requires double quotes); unquoted keys; comments (JSON has no comment syntax); or a missing closing bracket or brace. The error message will point to the approximate location.

What is the difference between JSON and JavaScript objects?

JSON is a strict text format — all keys must be double-quoted, no trailing commas, no comments, no undefined, no functions. JavaScript object literal syntax is more lenient. JSON is language-independent; JavaScript can parse it with JSON.parse() and produce it with JSON.stringify().

When should I minify vs pretty-print JSON?

Pretty-print for reading, debugging, and version control (diffs are easier to read). Minify for production API responses and file storage where you want smaller payloads. Minifying a large JSON file can reduce its size by 20–40 %.