Nothing you open here is ever uploaded

Minify JSON

The text is parsed and written back out with no space between the tokens, and you are shown the length before, the length after and the difference as a percentage. It runs a moment after you stop typing. Whitespace inside your strings is data rather than formatting, so it is left exactly as it was.

This page loads no libraries at all. The work is done by the browser itself. Your file is read on your own machine and never sent anywhere. Open your browser’s network tab and watch while you use it.

Questions

Does anything besides the whitespace change?

Your values survive, but the rewriting leaves marks of its own. A repeated key keeps only its last value. Numbers come back in JavaScript’s form, so 1.0 becomes 1 and 1e3 becomes 1000, and past about seventeen digits the tail turns to zeros. Escape sequences inside strings are rewritten to their shortest form.

Is the key order kept?

Insertion order is kept for ordinary string keys. Keys that are plain whole numbers are the exception. JavaScript moves those to the front in numeric order, so an object keyed by id comes back sorted rather than in the order you wrote it. A key like 01 or -1 does not count as a number and stays where it was.

How is the saving measured?

By counting characters before and after. The summary calls them bytes, which holds only while the JSON is all ASCII. If yours has accented letters, CJK or emoji, each of those is more than one byte in a file while the spaces you removed were one byte each, so the real saving on disk is smaller than the percentage shown here.

Will it shorten key names or drop empty values?

No. Key names, nulls, empty strings, empty arrays and empty objects all stay as they are. Only the space between tokens goes. This is not compression, and it will not make a large file small on its own.

Other text & code tools

Everything here is free and works the same way, in your browser.

New tools, once in a while

A new DeskKit tool lands every week or two. Leave an address to hear about it. Nothing else is ever sent, and one click removes you.