JSON Utilities

Json Diff

Compare JSON objects to identify structural differences, added/removed keys, and changed values. Use via MCP in Claude Code or Windsurf, or call GET /v1/json/diff directly. Returns detailed diff showing operations needed to transform one JSON into another. Perfect for API response validation, configuration changes, and data migration verification.

API Endpoint

GET /v1/json/diff

Code Examples

curl "https://tinyfn.io/v1/json/diff" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/json/diff', {
  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/diff',
    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 does JSON diff handle nested objects and arrays?

Recursively compares nested structures, tracking path-based differences like 'user.address.city' changed from 'NYC' to 'Boston'. Array differences show index-level changes and element additions/removals.

What format does the JSON diff output use?

Returns structured diff with operation types (add, remove, replace), JSON paths, and old/new values. Compatible with JSON Patch RFC 6902 format for programmatic processing.

Can I use JSON diff in MCP-enabled AI coding tools?

Yes, works seamlessly in Cursor, Windsurf, and Claude Code. AI agents can compare API responses, validate data transformations, or check configuration drift without hallucinating differences.

How does it handle type changes between JSON values?

Detects type changes like string to number or object to array, marking them as 'replace' operations with both old and new type information for accurate comparison.

What's the difference between JSON diff and text diff?

JSON diff understands data structure semantically—key order doesn't matter, but value changes do. Text diff compares character-by-character, missing logical JSON relationships.

Try Json Diff Now

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

Get Free API Key