Skip to content
POST AI agent ready /v1/json/minify

JSON Minify API - Free Compact JSON

Strips all unnecessary whitespace, line breaks, and indentation from a JSON string. The output is the smallest valid JSON representation of the input, ideal for reducing payload sizes in network transfers.

Parameters

stringrequired

The JSON string to minify.

Code examples

curl -X POST https://api.botoi.com/v1/json/minify \
  -H "Content-Type: application/json" \
  -d '{"json":"{\n  \"name\": \"botoi\",\n  \"version\": 2\n}"}'

When to use this API

Shrink config payloads before storage

Minify JSON configuration blobs before storing them in databases or key-value stores to save storage space.

Reduce API response size

Strip whitespace from outgoing JSON responses in your API gateway to cut bandwidth usage and speed up transfers.

Frequently asked questions

How much smaller does the output get?
It depends on the original formatting. A 2-space-indented JSON file typically shrinks by 15-30%. Deeply nested structures save more.
Does minification change keys or values?
No. Only whitespace is removed. Keys, values, and structure remain identical.
Can I minify JSON that contains comments?
Standard JSON does not support comments. If your input has comments, the API returns a parse error. Remove comments first.
Is the output still valid JSON?
Yes. The output is always valid JSON, functionally equivalent to the input.

Get your API key

Free tier includes 5 requests per minute with no credit card required. Upgrade for higher limits.