Minify and Beautify JSON

Paste any JSON, or drop a .json file, and see the minified and beautified versions side by side, updated instantly. Nothing is sent anywhere.

Minify and Beautify JSON

Drop your JSON file here

Up to 20MB per file. Stays on this device.

Nothing is sent anywhere. Turn off your Wi-Fi and this page still works - try it.

How it works

  1. Drop or choose a .json file, or paste JSON directly into the text box.
  2. Both the minified (no whitespace) and beautified (indented, one field per line) versions render immediately.
  3. Pick 2 spaces, 4 spaces, or a tab for the beautified indent if you need it to match your codebase. Copy or download whichever result you need.
Example output

Input

{
  "user": {
    "name": "Ada",
    "roles": [
      "admin",
      "editor"
    ]
  }
}

Output (minified)

{"user":{"name":"Ada","roles":["admin","editor"]}}

A small nested object, minified to remove every character that isn’t part of the data.

Frequently asked questions

Is my JSON sent anywhere?

No. Pasted JSON and uploaded files are both read and converted entirely on your device, and nothing is sent to a server. Turn off your Wi-Fi after the page loads and it still works. This page loads 10KB of JavaScript, gzipped - about what your browser's network tab will show for this page's own scripts.

What’s the difference between minify and beautify?

Minifying strips every character that isn’t part of the data itself - spaces, newlines, indentation - producing the smallest valid JSON text, which is what you want before shipping a config file or API response. Beautifying does the opposite: it adds consistent indentation and line breaks so a human can read the structure at a glance. Both are the exact same data, just formatted differently - this tool computes both from whatever you paste, so you never have to choose one and lose the other.

Why does it say my JSON isn’t valid?

JSON has stricter rules than JavaScript object literals: keys and string values need double quotes (not single quotes), there’s no trailing comma after the last item, and comments aren’t allowed. The error message names the exact problem your browser’s own JSON parser found, in the same words it would give a developer, so you can jump straight to the spot instead of scanning the whole file.

Does this change the order of my object’s keys, or the type of any value?

No. Both the minified and beautified output preserve key order exactly as written, and every value keeps its original type - a number stays a number, a string stays a string, true/false/null stay exactly as they were. Only whitespace changes.

Can I choose 4 spaces or tabs instead of 2 spaces for the beautified version?

Yes - the indent dropdown above the beautified panel switches between 2 spaces, 4 spaces, and a tab, and the result updates immediately with no need to re-paste or re-upload.

What happens with a very large JSON file?

Files up to 20MB are accepted. Both panels show a preview of very large results (with a note that it’s been shortened) so the page itself stays responsive - download or copy the result to get the complete, untruncated text either way.

Files are processed locally in your browser and never uploaded. Read more on the privacy page.