LFUnminify, online code unminifier by Ludovic Frank
EN

Unminify JSON online

Paste an API response, a config file or a log line and read it properly. Objects and arrays are indented by depth, one key per line, with syntax highlighting on the result.

Your unminified, beautified code will appear here

Why JSON arrives compressed

JSON is the default language of APIs, and APIs optimise for bytes rather than for eyes. A response from a REST endpoint or a GraphQL server is serialised without a single space, which is exactly right for the network and exactly wrong for a human. The same applies to configuration files committed by tooling, to structured log lines, to JSON-LD blocks embedded in a page, and to anything you copy out of the network tab of your devtools.

Formatting makes the structure obvious

Indented JSON answers structural questions instantly. How deep does this object go, is that field an array of objects or an object of arrays, which key is null when you expected a value, where does one record end and the next begin. Scanning a formatted payload for a missing or misspelled key takes seconds, while doing the same on a single line usually means giving up and writing a script instead.

Invalid JSON is caught immediately

Because the input has to be parsed before it can be printed, formatting is also the fastest validity check available. A trailing comma, a single quoted string, an unescaped quote inside a value or a truncated response will stop the parse and show you an error rather than a result. That is frequently how you discover that the API response you were debugging was cut short, or that a config file has one comma too many.

JSON, JSON Lines and JSONP

This page formats a single JSON document. If your input is a log file with one JSON object per line, format the individual lines you care about rather than the whole file, since the file as a whole is not one valid document. And if a response starts with a function name wrapped around the data, it is JSONP rather than JSON, which is exactly why the tool sometimes detects a payload as JavaScript. In that case the detection is right, and formatting it as JavaScript still gives you a perfectly readable result.

Frequently asked questions

Does it validate my JSON?

Effectively yes. The document has to parse before it can be formatted, so any syntax error stops the process and is reported instead of a result. It is the quickest way to check whether a payload is well formed.

Is the key order preserved?

Yes. Keys stay in the order they appear in the source document, nothing is sorted or rearranged. Only whitespace and line breaks change.

Can I format very large API responses?

Yes, within reason. Payloads of several megabytes are handled, though they take a moment because the parsing runs on your own machine. Nothing is uploaded, which is what makes it safe to paste a response containing internal data.

Unminify another format