JSON
JSON Minifier
Minify JSON for transport, fixtures, or compact storage while checking before and after character counts.
0 input characters ยท press Ctrl/Command+Enter to run
0 output characters
Runs locally in your browser. Your input is not uploaded.
How this tool works
JSON minification strips indentation and line breaks while preserving the parsed data structure.
The size comparison helps you see how much whitespace was removed.
Examples
- Minify a sample API response before embedding it in a test.
- Download compact JSON for a small static data file.
- Minify a formatted fixture and compare parsed input and output before measuring the character reduction.
Common use cases
What minification removes
JSON minification removes whitespace that is not part of string values. It does not compress strings, shorten key names, remove fields, or change the data model.
The before and after counts are useful for small payloads, embedded fixtures, and examples where compact output matters.
Safe minification habits
- Minify only after the JSON parses successfully.
- Keep a readable source copy for configuration files that humans maintain.
- Do not minify private payloads for tickets or documentation before redacting sensitive fields.
Invalid or unsafe assumption
Invalid/failure example
Minifying malformed JSON must fail rather than remove whitespace blindly.
Mistakes to avoid
- Removing spaces inside string values.
- Minifying before debugging a production incident.
- Claiming minification is compression or encryption.
Limits of this workflow
Minification removes insignificant JSON whitespace only.
Transport compression generally saves more bytes than whitespace removal alone.
Local-processing and privacy boundary
Parsing, measurement, and download happen locally; exported compact data may still contain sensitive values.
Practical workflow
- Validate and parse the source.
- Create compact JSON from parsed data.
- Compare semantic equality.
- Use the compact file only where readability is not needed.
Related guides
Official references
FAQ
Does minifying JSON remove data?
No. It removes whitespace outside strings after parsing and serializing the JSON value.
Why must JSON be valid first?
Parsing first prevents producing misleading output from malformed input.
Does minification remove spaces inside strings?
No. Spaces that are part of a JSON string value are data and remain unchanged.