Encoding Utilities

Json Prettify

Formats JSON with proper indentation and spacing for readability. Call via MCP in Cursor or Windsurf, or hit the REST endpoint `/v1/encode/json/prettify`. Pass minified JSON like `{"name":"John","age":30}` and get back cleanly formatted output with consistent 2-space indentation. Validates JSON syntax while formatting.

API Endpoint

GET /v1/encode/json/prettify

Code Examples

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

Call the json_prettify function with your JSON string as input. Works in Cursor, Claude Code, Windsurf, and other MCP-compatible editors to format minified JSON with proper indentation.

What indentation style does the JSON prettifier use?

Uses 2-space indentation with consistent formatting. Objects and arrays are properly nested with each key-value pair on its own line.

Does the prettifier validate JSON syntax before formatting?

Yes, it validates JSON syntax and returns an error for malformed input. Invalid JSON won't be processed, ensuring you only get valid, formatted output.

Can I prettify large JSON files or API responses?

Yes, handles JSON of various sizes including API responses, configuration files, and data exports. Maintains all data while improving readability.

What's the REST API endpoint for JSON prettification?

Send a GET request to `/v1/encode/json/prettify` with your JSON string as a parameter to get formatted output via HTTP.

Try Json Prettify Now

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

Get Free API Key