input.json
output.min.json
Paste JSON and click Minify to strip all whitespace.

Related

Guides for Minify

All guides →

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.