DevPocket

JSON minifier

Minifying JSON means removing the spaces, tabs and line breaks that add nothing to the data. The result is smaller and ideal for embedding in code, sending in a request or storing in an environment variable.

Whatever you paste into DevPocket is processed in your browser and is neither stored nor sent.

Loading the tool…

Before compacting, the tool validates the JSON: if there is an error it does not produce broken output, it tells you where the problem is. It also shows the size before and after in real bytes (UTF-8) and the percentage saved.

How to use it

  1. Paste the formatted JSON.
  2. Check that it is valid and review the bytes saved.
  3. Copy the minified JSON.

Frequently asked questions

Does minifying change the data?
No. Only whitespace outside strings is removed. Values, key order and string contents are preserved.
Is it worth it if the server already uses gzip?
Compression narrows the difference a lot, but minifying still saves some size and parsing time, especially for large files or files stored uncompressed.

Limitations

  • Regular expressions use the JavaScript engine; syntax may differ from PCRE, Python or Java.
  • The text diff is designed for documents up to about 2 MB.