DevToolCase
Sign in Sign in

Minify JSON

Remove the spaces and line breaks of a JSON to make it as small as possible, and find the exact line of a syntax error.

Share this result

Encrypted in your browser. The key stays in the link, after “#”: only the people you give it to can read it, not even DevToolCase.

The link works for

Sign in for longer links or links without expiry, and to find them in your account.

Runs entirely in your browser: nothing you type is sent or stored.

Why minify JSON?

Spaces, tabs and line breaks make JSON readable, but they carry no data. Minifying removes them all: an API response, a setting stored in a database or a test fixture gets smaller, with exactly the same meaning.

What minifying keeps

  • Strings, spaces inside them included: "New York" stays "New York".
  • The order of the keys and the values of the numbers.
  • Errors: an invalid JSON is not minified, its first error is shown with its line and column.

Minify or compress?

Web servers usually compress their responses with gzip or Brotli, which already shrinks white space a lot. Minifying still pays where nothing is compressed: data stored in a database, in a URL, in local storage or in a message queue.

To read a minified JSON again, format it.

Add this browser’s favorites to your account?

This browser has 0 favorites that your account does not have:

Either way, this browser keeps its favorites: you find them again after signing out.