← Blog

Compare JSON Online — JSON Diff Tool

JSON formatter blog · Open JSON Formatter

Side-by-side JSON comparison showing added removed and changed paths
Compare JSON Online — JSON Diff Tool

A JSON diff helps you compare two JSON documents by structure instead of scanning raw text. JSON Formatter & Converter includes Compare mode so you can paste version A and version B, review added, removed, and changed paths, and keep the work in your browser. It is free, private for normal paste-and-edit work, and does not require signup.

What Compare Mode Does

Compare mode is built for the common question: "What changed in this JSON payload?" Instead of treating the document as a plain block of text, it parses both sides as JSON and reports differences at the path level. If user.plan changes from "trial" to "pro", you see that path as changed. If features[2] appears only in the second version, you see it as added.

This makes the tool useful for API responses, config files, fixtures, saved settings, and webhook examples where object structure matters more than the exact placement of whitespace. It is not trying to be a full git-style text diff for every possible edge case. Formatting, key order, comments from non-standard JSON-like sources, and whitespace are not the focus. The goal is a readable structural comparison you can act on quickly.

A structural diff is especially helpful when both versions are valid but hard to review by eye. Large payloads often include timestamps, IDs, nested metadata, feature flags, and arrays of records. Compare mode lets you move from “something is different” to “this exact path changed” without manually searching both documents.

How To Compare JSON Online

  1. Open JSON Formatter & Converter.
  2. Switch to Compare mode.
  3. Paste the original JSON into side A and the updated JSON into side B.
  4. Format or validate each side if needed, then review the side-by-side results.
  5. Use the path list to find added, removed, and changed values without manually searching the whole document.

If you only have one document and want to clean it first, start with JSON formatter online or validate JSON online. Clean input makes the comparison easier to understand.

For the clearest result, compare documents at the same stage of cleanup. If one side is formatted and the other is minified, that is fine because the comparison parses JSON first. If one side has null fields stripped, sorted keys, flattened paths, or converted values, apply the same preparation to the other side before comparing so the diff reflects real data changes rather than workflow differences.

Example JSON Diff

Version A:

json
{
  "user": {
    "id": 42,
    "plan": "trial",
    "active": true
  },
  "features": ["format", "validate"]
}
{
  "user": {
    "id": 42,
    "plan": "trial",
    "active": true
  },
  "features": ["format", "validate"]
}

Version B:

json
{
  "user": {
    "id": 42,
    "plan": "pro",
    "active": true,
    "region": "us"
  },
  "features": ["format", "validate", "compare"]
}
{
  "user": {
    "id": 42,
    "plan": "pro",
    "active": true,
    "region": "us"
  },
  "features": ["format", "validate", "compare"]
}

In a structural JSON diff, user.plan is changed, user.region is added, and features[2] is added. The unchanged values still provide context, but the important result is the path-level summary.

Structural Diff Vs Text Diff

A text diff compares characters and lines. That is perfect for source control, but it can be noisy for JSON. Reformatting a document from two spaces to four spaces may create a large text diff even when no data changed. A structural JSON diff parses both documents first, then compares objects, arrays, values, and paths.

  • Added means a path exists in B but not in A.
  • Removed means a path exists in A but not in B.
  • Changed means the same path exists in both versions, but the value differs.

Arrays deserve special attention. If records are reordered, a simple index-based comparison may show changes even when the objects are the same records in a different order. For data sets where order is not meaningful, consider sorting or normalizing the input before comparing.

Troubleshooting noisy JSON diffs

If the diff looks larger than expected, first validate both documents. Invalid JSON, truncated text, or accidental wrapping can make a structural comparison impossible. Next, check whether one side has extra generated fields such as timestamps, IDs, request IDs, or debug metadata. Those fields may be expected differences rather than bugs.

When arrays create noise, decide whether order matters for the workflow. If order is meaningful, index-level changes are useful. If order is not meaningful, sort the records outside the comparison or compare smaller sections that focus on the fields you care about. For deeply nested data, use the Tree tab first to locate the branch, then compare that branch on its own.

If two values look the same but still compare as different, check their JSON types. The number 42 is not the same as the string "42". The boolean false is not the same as "false". A structural diff should preserve those differences because consumers often treat them differently.

When A JSON Diff Helps

JSON comparison is helpful when you are reviewing a response before and after a settings change, checking whether a webhook sample changed, comparing a saved export with a new export, or debugging why a client receives a different payload than expected. It is also useful for product and QA reviews because the path list is easier to discuss than a long pasted object.

If the document is large, use the formatter and tree outline first to understand the shape. If the key concern is payload weight, use the JSON size calculator. If you need a compact payload after review, use minify JSON online.

Honest limits of online JSON compare

Compare mode is a practical browser tool for reviewing parsed JSON structures. It is not a replacement for source control history, contract testing, schema validation, or a custom business-rule diff. It will not know that two reordered records are the same customer unless the input has been normalized in a way that makes that relationship obvious.

Very large documents can also become heavy in the browser. If a full export is difficult to load or review, compare a focused sample, a single object, or the branch where you expect the change. Smaller comparisons are often more useful because they remove unrelated noise and make the changed path easier to explain.

Import URL And Privacy

Pasting, formatting, validation, and comparison run in your browser. Tools Viewer does not require an account for Compare mode. If you use Import URL, your browser fetches the remote resource directly, and the remote host must allow CORS. Tools Viewer does not proxy that request. For private payloads, pasting local text or opening a local file keeps the workflow on your device.

If you need to compare content from a remote URL, remember that the remote host sees the request from your browser. For sensitive payloads, use local files or clipboard text instead of fetching from a service you do not control. After comparison, copy or download only the output you are comfortable sharing.

Related JSON Workflows

Compare mode is often part of a longer workflow. You might validate both sides, compare the paths, stringify a result for embedding, and then convert a fixture for another tool. The JSON Formatter cluster includes convert JSON to YAML, CSV, and TSV, JSON stringify online, flatten JSON online, convert JSON to XML, and JSONL to JSON.

FAQ

Can I compare JSON online for free?

Yes. JSON Formatter & Converter includes Compare mode for free, with no signup required.

Does the JSON diff compare structure or text?

Compare mode focuses on structural path-level differences: added, removed, and changed paths after parsing JSON.

Can I compare two API responses side by side?

Yes. Paste one response into side A and the other into side B, then review the side-by-side comparison and path summary.

Is this a full git-style diff?

No. It is designed for readable JSON structure comparison, not every text-diff edge case.

Why do arrays show many changes?

Array comparison is usually index-based. If records moved to different positions, normalize or compare a smaller branch when order is not meaningful.

Does comparing JSON upload my data?

No. Pasted JSON is parsed and compared in your browser. Import URL fetches from your browser and requires CORS from the remote host.

What should I do before comparing invalid JSON?

Validate or format each side first. Invalid JSON must be fixed before a structural comparison can be trusted.

Start with JSON Formatter & Converter or read the JSON Formatter guide. Related: JSON formatter online, validate JSON online, Python dict to JSON, convert JSON to XML, and JSONL to JSON.