Skip to content

JSON Minifier

Remove whitespace from JSON to make it smaller.

  • 100% Free
  • No Sign Up
  • Works in Your Browser

JSON minifier

Strip whitespace from JSON

More Developer Tools

View all tools

Every everyday developer tool, right in your browser.

No installs. No uploads. No signup.

Browse all 36 tools
Developer tools
36
Cheat sheets
10
Bytes uploaded
0

How to use the JSON minifier

Three steps, all in your browser.

  1. 1

    Paste your input

    Type or paste your code or data. Press Sample to try an example.

  2. 2

    Pick the style

    Choose indentation or options. The result updates as you type.

  3. 3

    Copy the result

    Copy the output in one click. Nothing is saved or sent anywhere.

JSON Minifier: what to know

The JSON minifier removes every space, tab and line break that sits between tokens, giving the smallest valid version of the same JSON. Whitespace inside string values is part of the data and is kept, so the result parses to exactly the same value as the original.

Minified JSON is what servers usually send: it's smaller over the network and in storage, and slightly faster to parse. The tool shows the size before and after so you can see the saving, which is typically largest for deeply indented documents.

If your server already compresses responses with gzip or Brotli, much of the whitespace saving is absorbed by compression, but minifying still helps for JSON embedded in HTML, stored in databases or caches, or sent through channels with size limits such as environment variables and message queues.

Popular uses

  • Embedding JSON in a script tag or data attribute
  • Fitting JSON into an environment variable or CLI argument
  • Shrinking fixtures and seed files
  • Sending compact payloads through message queues

Tips for the best result

  • Keep the formatted version in your repository and minify at build time, so diffs stay readable.
  • Minifying also validates: if the JSON is invalid you get the error instead of output.
  • For JSON in an HTML script tag, escape </ as <\/ so the browser can't end the tag early.

Read how JustYourDev works and our privacy details. Code, data and files you use here are processed in your browser and are never sent to our server.

Frequently asked questions