Encoding Utilities

Json Minify

Strips whitespace from JSON strings for smaller payloads and storage efficiency. Use via MCP in Cursor or Windsurf, or call GET /v1/encode/json/minify directly. Input `{"name": "test", "values": [1, 2, 3]}` becomes `{"name":"test","values":[1,2,3]}`. Preserves JSON validity while reducing size by ~30-60%.

API Endpoint

GET /v1/encode/json/minify

Code Examples

curl "https://tinyfn.io/v1/encode/json/minify" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/encode/json/minify', {
  headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests

response = requests.get('https://tinyfn.io/v1/encode/json/minify',
    headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)

Use via MCP

Add to your AI agent

Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's encoding tools:

{
  "mcpServers": {
    "tinyfn-encoding": {
      "url": "https://tinyfn.io/mcp/encoding",
      "headers": {
        "X-API-Key": "YOUR_API_KEY"
      }
    }
  }
}

Learn more about MCP setup →

FAQ

How much smaller does JSON minification make files?

Typically 30-60% reduction depending on original formatting. Heavily indented JSON with lots of spaces sees the biggest gains.

Does minifying JSON break anything or change the data?

No, minification only removes whitespace and preserves all data, structure, and JSON validity. Functionally identical to the original.

Can I minify invalid JSON or will it fail?

The tool will return an error for malformed JSON. Input must be valid JSON syntax to be processed successfully.

How do I use JSON minify with MCP in my AI coding assistant?

Your AI agent can call the json_minify tool directly when you need to compress JSON for APIs, configs, or storage optimization.

What's the difference between minify and prettify for JSON?

Minify removes whitespace to reduce size, while prettify adds formatting for readability. They're opposite operations with different use cases.

Try Json Minify Now

Get your free API key and start using Json Minify in seconds.

Get Free API Key