JSON Minify Online
Compress valid JSON into a compact single line for APIs, environment variables, logs, and embedded payloads.
Related
Guides for Minify
Fix Invalid JSON: From 'What's Wrong' to a Clean File
Repair JSON that looks almost right — trailing commas, single quotes, unquoted keys — using a smart formatter that tolerates almost-JSON and then validates strictly.
Fix Trailing Comma in JSON
A trailing comma after the last object property or array item is valid in some JavaScript contexts, but it is not valid JSON.
Validate JSON Before API Requests
A quick validation pass before sending an API request can separate JSON syntax problems from authentication, schema, and backend errors.
What does JSON minify do?
Minifying JSON removes all whitespace — spaces, tabs, and newlines — that is not inside a string value. The result is a single-line JSON string that is functionally identical to the original but smaller on the wire.
When to minify JSON
- API payloads — smaller request bodies mean faster network transfers
- Environment variables — most shells and CI systems expect a single-line value
- Embedding in URLs — compact JSON is easier to percent-encode and stays under length limits
- Database storage — single-line JSON avoids issues with newline handling in some databases
If your input has syntax errors (single quotes, trailing commas, comments), the tool attempts to repair them before minifying. Use the JSON Fix tool for more detailed repair and formatting.