Minify and compress JSON data by stripping unnecessary whitespace and line breaks.
Loading tool
About JSON minify
Remove every unnecessary space, tab and line break from JSON while leaving strings and number formats exactly as written. Optionally strip // and /* */ comments so JSONC files such as tsconfig.json can be minified too. The result is validated, and the original size, minified size and percentage saved are shown.
Common uses
- Shrink a JSON payload before sending it in a request or storing it
- Fit JSON into a single-line environment variable or config value
- Strip comments from a JSONC file to get strict JSON
- See how much whitespace a JSON file contains
FAQ
- Does minifying JSON change the data?
- No. Only whitespace outside of strings (and optionally comments) is removed. Unlike parsing and re-serializing, this tool keeps number formats such as 1.50 exactly as written.
- Can JSON contain comments?
- Standard JSON does not allow comments. Formats like JSONC, used by VS Code and tsconfig.json, permit them, so enable comment stripping to turn them into valid JSON.
- Is minifying the same as compressing?
- No. Minifying removes characters that are not needed; compression like gzip or Brotli encodes the bytes more compactly. They can be combined, though gzip already shrinks repetitive whitespace well.