Skip to content
Cuisdev

JSON Minifier

Strip whitespace to shrink JSON for production

  • Runs in your browser
  • No sign-up
  • Free forever
Loading the tool…

How to use the JSON Minifier

  1. 1

    Paste formatted JSON into the editor, or drop a .json file onto it.

  2. 2

    Press Compact in the menu bar (Ctrl+Shift+I) to remove all whitespace. Press Format (Ctrl+I) to expand it again.

  3. 3

    Use Copy > Copy compact to put the single-line JSON on your clipboard, or Save to download it.

Features

  • Removes every space, tab and newline outside of strings
  • Shows input size, output size and the percentage saved
  • Validates first, so you never ship a broken document
  • Handles files up to 25 MB locally in your browser
  • Copy or download the result in one click
  • Works offline after the first load

When minified JSON matters

Every byte an API returns is a byte the client has to download and parse. Formatted JSON carries indentation and newlines that machines do not need. Minifying removes them, which cuts transfer size, speeds up parsing on slow devices and keeps you under size limits in places like HTTP headers, local storage and message queues.

Minify versus compress

Minification and compression solve different problems. Minification deletes characters that carry no information. Compression (gzip, Brotli) encodes repeated patterns more efficiently. A minified document compresses better than a formatted one, so the right answer is almost always to do both: minify at build time, compress at the server.

Going back

Minified JSON is hard to read. If you need to inspect a compact document, paste it into the JSON Formatter and it becomes readable instantly. The JSON Editor does both in one place.

Frequently asked questions

Does minifying change the data?
No. Only whitespace outside of string values is removed. Every key, value and type is preserved and the result parses to exactly the same object.
How much smaller will my JSON be?
Typically 20 to 40 percent for formatted documents, depending on indentation depth and how long the strings are. The status bar shows the exact figure for your input.
Should I minify JSON in my repository?
Usually not. Keep the formatted version where humans read and review it, and minify at build or response time. Minify in the repo only for files that are never hand-edited.
Is gzip better than minifying?
They stack. Gzip or Brotli compression on your server handles repeated text well, but minifying first still saves bytes and reduces parse time on the client. Do both.
Is my data uploaded?
No. The minifier runs in your browser and nothing is transmitted.

Last updated .