Snipget.ai

Json minify

Exact
json_minify

Deterministic and authoritative — the canonical answer for this input.

Minify a JSON document by removing all insignificant whitespace. Returns the compact output plus original and output sizes. Processing multiple inputs? Use `json_minify_batch` to do up to 1000 in one call.

Parameters

valuestringrequired

The JSON text to minify.

Call it

curl -X POST https://api.snipget.ai/v1/json/minify \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"value":"{ \"name\": \"Ada\", \"age\": 36 }"}'

The Batch tab sends up to 1000 inputs in one call via /v1/json/minify/batch.

Example response

{
  "input": "{ \"name\": \"Ada\", \"age\": 36 }",
  "is_valid": true,
  "output": "{\"name\":\"Ada\",\"age\":36}",
  "original_size": 28,
  "output_size": 23
}

FAQ

What does minify do?

It strips out all the spaces and line breaks that are only there for readability, producing the smallest valid version of the same JSON. Useful for shrinking payloads before sending them over the wire.

Does it change my data?

No. Only whitespace is removed. The keys, values, and structure are identical, and the result is exact and reversible by prettifying it again.

Does it reorder or drop anything?

No. Key order is preserved and nothing is dropped. It does not sort keys or remove duplicate-looking values.

It also reports sizes, why?

The result includes the original and minified character counts so you can see how much you saved at a glance.

What if the JSON is invalid?

It returns confidence 0 with a reason instead of an error. Minify only runs once the input parses as valid JSON.

Related tools