JSON Utilities

Minify Json

Removes whitespace, newlines, and indentation from JSON strings for size optimization. Use via MCP in Cursor/Claude or GET /v1/json/minify REST endpoint. Input `{"name": "test", "value": 123}` returns `{"name":"test","value":123}` — cutting payload size by ~30% while preserving data integrity.

API Endpoint

GET /v1/json/minify

Code Examples

curl "https://tinyfn.io/v1/json/minify" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/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/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 json tools:

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

Learn more about MCP setup →

FAQ

How much space does JSON minification typically save?

Usually 20-40% reduction depending on original formatting. Heavily indented config files see larger savings, while already compact JSON sees minimal reduction.

Does minifying JSON change the actual data or just formatting?

Only removes whitespace and formatting — the parsed JSON object remains identical. All keys, values, and structure are preserved exactly.

Can I minify invalid JSON or will it throw an error?

Invalid JSON will return an error. The tool validates JSON structure first, then minifies only syntactically correct input.

How do MCP agents use JSON minification in development workflows?

Common for optimizing API payloads, config files, or data transfer. Agents in Cursor often minify before embedding JSON in code or sending to external services.

What's the difference between minifying and prettifying JSON?

Minification removes whitespace for smaller size, while prettifying adds indentation and newlines for readability. They're opposite operations serving different needs.

Try Minify Json Now

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

Get Free API Key