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.
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)
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"
}
}
}
}
Usually 20-40% reduction depending on original formatting. Heavily indented config files see larger savings, while already compact JSON sees minimal reduction.
Only removes whitespace and formatting — the parsed JSON object remains identical. All keys, values, and structure are preserved exactly.
Invalid JSON will return an error. The tool validates JSON structure first, then minifies only syntactically correct input.
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.
Minification removes whitespace for smaller size, while prettifying adds indentation and newlines for readability. They're opposite operations serving different needs.