JSON Minifier
Strip whitespace from JSON and compare original and minified sizes.
Format, validate and pretty-print JSON with clear error messages.
JSON Formatter takes JSON in any shape, checks that it is valid and prints it back with consistent indentation so you can read it. API responses and config files often arrive as one unbroken line; formatting them is the fastest way to see the structure and find the field you are looking for.
When JSON will not parse, the tool reports the problem in plain language along with the line and column where the parser gave up. Most invalid JSON comes down to a handful of mistakes: a trailing comma after the last item, single quotes instead of double quotes around keys, an unescaped quote inside a string, or a missing closing bracket. The error message points you at the spot rather than making you hunt.
Parsing uses the browser's built-in JSON parser. The tool never evaluates your input as code, so pasting JSON from an untrusted source is safe, and nothing is transmitted to a server.
The json formatter is used by writers, developers, students, marketers and anyone else who needs the job done once without installing software. Common cases include:
The usual causes are a trailing comma after the final item in an object or array, single quotes instead of double quotes, unquoted keys, or a stray character copied from a rich text editor. The error message gives the line and column where parsing stopped, which is normally one character past the real mistake.
No. Comments are not part of the JSON specification, so a file containing them is not valid JSON and will be rejected. Strip the comments first if you are working with a format such as JSONC.
No. Only whitespace changes. Keys, values, types and array order stay exactly as they were, unless you choose the option to sort keys alphabetically.
No. The browser's own parser handles everything inside the page, so API keys and customer data in a payload never leave your device.
Documents of several megabytes format without trouble on a normal machine. Very large files may take a moment and will use memory in the tab, but nothing is uploaded.
Sorting keys gives two versions of the same object a consistent order, which makes them far easier to compare in a diff tool or by eye.
If the json formatter is not quite what you need, these other free tools solve closely related problems.
Strip whitespace from JSON and compare original and minified sizes.
Encode any text, including emoji and accents, to a Base64 string.
Escape spaces, symbols and non-ASCII characters for use in URLs.
Escape angle brackets and quotes to HTML entities, or decode them back.
Translate between Unix time and human-readable dates in both directions.