JSON Minifier
Turn formatted JSON into a compact single line. Remove indentation and line breaks outside strings, then copy the result for a request body, fixture, or configuration.
JSON source editor
Remove JSON formatting whitespace for a compact payload
Minification removes whitespace used for presentation, including indentation and line breaks between properties. Spaces that are part of string values remain. This tool first parses the JSON and then serializes it into a single line. Invalid input is left untouched so a broken payload is not silently treated as a successful result.
How to use the JSON Minifier
- Paste valid, formatted JSON into the editor.
- Choose Minify JSON to produce a compact single line.
- Copy the result, or choose Format to make it readable again.
JSON Minifier example
{
"message": "hello world",
"count": 2
}The compact result is {"message":"hello world","count":2}. The space between hello and world stays inside the string.
Syntax checks and data representation
The tool uses JavaScript JSON parsing. Syntax validation does not check a schema or application rules. Formatting and minification parse and serialize the document: duplicate property names collapse to the last value, integer-like keys may reorder, and numbers beyond JavaScript’s safe integer range can lose precision. Keep long numeric identifiers as strings and retain your original source when exact representation matters.
JSON Minifier questions
Is JSON minification the same as gzip compression?
No. Minification produces ordinary JSON with less formatting whitespace. Gzip and Brotli encode content for storage or transfer and are separate steps.
Does minification remove spaces inside strings?
No. String content is retained. The tool removes presentation whitespace outside strings by parsing and serializing the JSON.
Can I minify JSON with comments or trailing commas?
No. The input must be valid strict JSON. Remove comments and trailing commas before minifying.