JSON Utilities

Prettify Json

Formats compressed JSON strings into readable, indented output with proper line breaks and spacing. Use via MCP in Cursor or Claude Code, or call GET /v1/json/prettify with your JSON string. Returns consistently formatted output with 2-space indentation. Essential for debugging minified API responses and config files.

API Endpoint

GET /v1/json/prettify

Code Examples

curl "https://tinyfn.io/v1/json/prettify" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/json/prettify', {
  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/prettify',
    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 do I prettify JSON using MCP in Cursor?

Call the json_prettify tool with your JSON string as input. The MCP tool handles URL encoding and returns formatted JSON with proper indentation and line breaks.

What's the difference between prettify and minify JSON?

Prettify adds whitespace, indentation, and line breaks for readability. Minify removes all unnecessary whitespace to reduce file size. They're opposite operations.

Does the JSON prettifier validate syntax?

Yes, invalid JSON will return an error response. The tool parses the JSON first, so malformed syntax like missing quotes or trailing commas will be caught.

Can I customize the indentation spacing?

The tool uses 2-space indentation by default. For custom formatting options, you'd need to process the output further or use a different formatting approach.

What happens with very large JSON files?

The tool handles large JSON strings but consider performance for multi-MB files. For massive datasets, consider streaming or chunking the JSON processing.

Try Prettify Json Now

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

Get Free API Key