Back to Blog
Tutorial February 2025

How to Compare Two JSON Files

Comparing two JSON files or API responses shows exactly what was added, removed, or changed. This guide walks you through using a free JSON diff tool online—no install, no signup.

Why Compare Two JSON Files?

You might have two API responses (before and after a backend change), two config files, or two exports. A structural diff lists differences by path (e.g. user.name, items[2]) and shows old vs new values for changes. That's faster than eyeballing two blobs side by side.

Step 1: Get Your Two JSON Inputs

Have both JSON strings ready—from files, API calls, or our JSON formatter. They don't need to be formatted the same way; the diff compares structure and values, not whitespace.

Step 2: Use the JSON Diff Tool

Open our JSON diff page. Paste the first JSON in the left box and the second in the right box. Click Compare. The result shows: Added (green)—paths only in the right side; Removed (red)—paths only in the left; Modified (amber)—same path, different value, with old and new shown.

Step 3: Read the Diff by Path

Paths look like user.email or items[0].name. For modified entries we show the previous value (struck through) and the new value. Use this to verify API changes, config drift, or data exports.

Arrays and Nested Objects

The diff handles nested objects and arrays. Array elements are compared by index, so added or removed array items show up as added/removed at that index. For more on JSON structure, use our formatter or validator.

Summary

To compare two JSON files: paste one in the left box and one in the right box on our JSON diff page, then click Compare. Use the added/removed/modified list to see what changed. For other JSON tasks see our developer tools.