How to Compare Two JSON Objects Online — Free JSON Diff Tool
Comparing two JSON objects manually is tedious and error-prone. Whether you are debugging an API response, validating a config change, or tracking down a data migration issue, a proper diff tool saves time and catches mistakes you would otherwise miss. Here is everything you need to know — plus a free browser-based tool to do it instantly.
In This Guide
What Is a JSON Diff?
A JSON diff (short for difference) is a comparison between two JSON objects that shows exactly what changed between them. It identifies three types of differences:
Keys that exist in the second object but not in the first
Keys that exist in the first object but not in the second
Keys that exist in both objects but have different values
Unlike a plain text diff that compares strings line by line, a JSON-aware diff understands the structure of the data. It does not care about key ordering or whitespace — it compares the actual values at each path in the object tree.
Common Use Cases
JSON comparison comes up constantly in software development. Here are the situations where it is most useful:
How to Compare JSON Objects Online
The fastest way is to use a free browser-based tool. No installation, no account, no data leaving your machine.
Steps
- Open the JSON Compare tool.
- Paste your first JSON object into the JSON A box on the left.
- Paste your second JSON object into the JSON B box on the right.
- Click Compare JSON.
- Review the diff table — added keys in green, removed in red, changed in yellow.
The tool also has a Load Example button if you want to see how the output looks before entering your own data. You can toggle "Hide unchanged keys" to focus only on what actually changed, which is useful when the objects are large.
The diff for these two objects would show: age changed from 30 to 31, role changed from "admin" to "user", active was removed, and city was added.
What the Diff Results Mean
Once you run a comparison, the results table shows three columns: the key path, the value from JSON A, and the value from JSON B. Here is how to read it:
| Row color | Meaning | Action |
|---|---|---|
| Green | Key exists only in JSON B | Newly added field — confirm it is intentional |
| Red | Key exists only in JSON A | Deleted field — check if it was supposed to be kept |
| Yellow | Key exists in both but with different values | Modified field — verify the new value is correct |
| Plain | Key exists in both with the same value | Unchanged — no action needed |
Nested Objects and Arrays
Real-world JSON is rarely flat. Objects are nested inside objects, and arrays contain objects of their own. A good JSON diff tool handles this by flattening the structure into dot-notation key paths so you can see exactly where a nested value changed.
The tool flattens this into paths like user.name and user.address.city, making it easy to pinpoint exactly which nested value changed — even inside deeply nested structures.
Arrays are compared by their JSON serialization. If the order of items in an array changes, the tool will flag the array as changed. For order-independent array comparisons, you would need to sort the arrays before comparing — or use a more specialized tool.
Tips for Cleaner Comparisons
Format your JSON first
Pretty-printed JSON is easier to read. Run your JSON through a formatter before comparing — many editors and tools (including our JSON Formatter) can do this in one click.
Remove dynamic fields
Fields like timestamps, request IDs, or session tokens will always differ. Strip them before comparing if you only care about structural changes.
Compare at the right level
If you are comparing two API responses, compare just the data object, not the full wrapper including status codes and headers.
Use the hide unchanged toggle
When objects are large, hide unchanged rows to focus on what actually changed. This makes the diff much faster to review.
Check your privacy
If your JSON contains sensitive data like tokens or PII, use a browser-based tool (like ours) that never uploads your data to a server.
Try the JSON Compare Tool
Free, browser-based, no signup. Paste two JSON objects and see every difference in seconds.
Open JSON Compare →Intellure Team
The Intellure team builds free, privacy-first online tools that work entirely in your browser. We write guides to help you get the most from our tools and the web, sharing practical tips and insights from our experience as developers and makers.
Try These Free Tools
Related Articles
JSON Formatting and Validation: A Developer's Quick Guide
A practical guide to JSON formatting, validation, and common mistakes. Learn JSON best practices and how to convert between JSON and CSV quickly.
5 Free Online Tools Every Developer Needs
Discover the essential free online tools that every developer should bookmark — from JSON formatting and regex testing to Base64 encoding and UUID generation.
JSON vs YAML: Differences, Use Cases, and When to Use Each
A practical comparison of JSON and YAML — syntax differences, strengths, weaknesses, and when to use each format for configuration, APIs, and data exchange.