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%.
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)
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"
}
}
}
}
Typically 30-60% reduction depending on original formatting. Heavily indented JSON with lots of spaces sees the biggest gains.
No, minification only removes whitespace and preserves all data, structure, and JSON validity. Functionally identical to the original.
The tool will return an error for malformed JSON. Input must be valid JSON syntax to be processed successfully.
Your AI agent can call the json_minify tool directly when you need to compress JSON for APIs, configs, or storage optimization.
Minify removes whitespace to reduce size, while prettify adds formatting for readability. They're opposite operations with different use cases.