JSON minify online

Processed locally
app.minify.view

You can also load data via #data={"name":"Ada"} or #url=... It is cleared from the address bar after it is read.

Strip newlines and extra spaces and minify JSON to one line. Useful for logs, environment variables, or pasting as an HTTP body. Processing is local. Format while developing, then minify before going live or embedding in a script—size and copy-paste both improve.

Smaller size

Whitespace in a readable format does not matter on the wire. Minified JSON is shorter and easier to copy. Deeper indent and nesting usually save more characters.

Logs, message queues, and some gateways prefer single-line JSON so one record is not split across lines.

Semantics stay the same

Only meaningless whitespace is removed. Numbers, strings, and field names are unchanged. After minify, JSON.parse should produce the same object.

Spaces and escaped newlines inside strings are kept, so copy is not trimmed.

Validate before minifying

Invalid input shows an error so bad data is not packed into a script. Trailing commas and single quotes are caught before minify.

Loose JS config should go through the JSON5 page to become standard JSON first.

Example

Input
{
  "api": "/v1/users",
  "method": "POST"
}
Minified result
{"api":"/v1/users","method":"POST"}
Are spaces inside strings removed?

No. Only whitespace between structure is removed. String contents stay as-is.

Which tool should I use when I need escaping?

Use this page for ordinary minify. To escape at the same time, use Minify & escape

Can I restore minified JSON?

Yes. Paste the result back into Format to expand it again. Semantics stay the same.

Is it uploaded to a server?

No. Minify runs only in the current tab.

Recommended workflow

  1. Confirm on the formatter that the JSON is valid and the fields are correct.
  2. Paste the same content here, or click “Load sample” to compare before and after.
  3. Copy the single-line result into a request body, environment variable, or log collector config.
  4. If you also need to embed it in a source-code string, use the minify-and-escape page for quotes.

For production config, keep a formatted version in the repo and minify at release time—easier Code Review and smaller transport size.