Skip to content
Devtoolry

JSON Minifier

Minify JSON online by removing all unnecessary whitespace, and see how many bytes you saved. Invalid JSON is reported with its line and column.

Runs in your browser · Nothing uploadedFree · No sign-up

Something not working, or missing a feature? Send feedback

About the JSON Minifier

Minified JSON is smaller to store and send. The JSON Minifier removes every unnecessary space and line break and shows how many bytes you saved.

Everything runs in your browser, so your input is never uploaded to a server.

How to use the JSON Minifier

  1. Paste JSON or open a file.
  2. Check the size saved shown below the output.
  3. Copy or download the minified JSON.

Example

Compress a config object

Input

{
  "name": "devtoolry",
  "version": "1.4.0",
  "features": ["formatters", "compilers"],
  "limits": { "maxUploadMb": 10, "timeoutMs": 5000 }
}

Result

{"name":"devtoolry","version":"1.4.0","features":["formatters","compilers"],"limits":{"maxUploadMb":10,"timeoutMs":5000}}

Spaces and line breaks between tokens are removed; spaces inside strings are kept.

Common mistakes

  • Minifying JSON with comments. JSONC files such as tsconfig.json may contain comments, which standard JSON does not allow. Remove the comments first or the minifier reports a syntax error.
  • Expecting a big saving after compression. Servers usually gzip or Brotli-compress JSON, which already removes most of the whitespace cost. Minify for storage, embedding and size-limited fields.
  • Large integer IDs. Numbers above 2^53 lose precision when parsed in JavaScript, so 12345678901234567890 comes out changed. Store such IDs as strings.

Works well with the JSON Minifier

Frequently asked questions

Is minified JSON still valid?

Yes. Only whitespace outside strings is removed; the data is identical.

Should I minify JSON for APIs?

Servers usually compress responses with gzip or Brotli, which removes most of the whitespace cost, but minifying still helps for stored or embedded JSON.

Does it change key order?

No. Keys stay in the order you wrote them. Duplicate keys are reduced to the last value, as every JSON parser does.

Is my data uploaded?

No. Minification uses your browser’s JSON parser, so the data never leaves your device.