About
See how Compare JSON reports structural and value changes, how its array and type-matching options work, and which features keep data local or send it over the network.
comparejson.com is a browser-based tool for finding meaningful changes between two JSON documents. You can paste or edit JSON, drag in files, or load JSON from a URL, then inspect additions, deletions, value changes, and type changes with their full key paths. It is intended for developers, QA engineers, data engineers, and anyone else who needs to review structured data without first writing a comparison script.
What semantic JSON comparison means
A text diff compares lines. Semantic comparison first parses both inputs as JSON and then recursively compares objects, arrays, values, and value types. Indentation and object key order therefore do not create differences, while a changed value inside a nested object remains visible.
For example, compare these two documents:
Base
{
"name": "Ada",
"active": true,
"roles": ["admin", "editor"]
}
Contrast
{
"roles": ["editor", "admin"],
"active": false,
"name": "Ada"
}
Moving name or roles to a different position in the object is not reported as a data change. The change at active from true to false is reported. The result for roles depends on the array setting: By Index reports changes at both positions, while Unordered finds the same two elements and does not report an array difference. This is why the array method should reflect whether order matters in your data.
Practical uses
- API development and testing: Compare an expected response with an actual response, or responses from two environments. Key paths help distinguish a missing field, an added field, a changed value, and a type mismatch in nested data.
- Configuration review: Check two JSON configuration snapshots after formatting, generation, or deployment. Semantic comparison filters out layout and object-key reordering so you can focus on effective setting changes.
- Data transformation and debugging: Compare input and output around a transformation, or inspect two exported states when a workflow behaves unexpectedly. A path such as
activeidentifies where to investigate; it does not by itself explain why the change occurred. - Fixtures and exports: Review changes to test fixtures, exported settings, and other structured files before using or committing them.
Result views and comparison options
The result page provides two ways to inspect the same inputs:
- Data Compare shows aligned, read-only structural views. Its sidebar groups differences by type, shows their full paths, and lets you jump to a difference or show and hide difference categories.
- Git Diff shows side-by-side, line-by-line differences in the original input text. Unlike Data Compare, this view includes formatting and object-key order changes.
Settings can be adjusted before comparing and on the result page:
- By Index compares array elements at the same positions; LCS preserves ordered common elements while identifying insertions and deletions; Unordered compares arrays as multisets, so order is ignored but duplicate counts still matter.
- Ignore key case and Ignore value case can suppress case-only differences when those differences are not meaningful for the data.
- Numeric String Equals Number can treat a numeric string such as
"42"as equal to the number42. Leave it off when that type distinction matters.
Limitations and when a text diff is better
Semantic comparison requires valid JSON and describes structural differences; it does not validate data against a JSON Schema, determine whether a change is correct, or apply business-specific equivalence rules. Array results depend on the selected matching method, and ignore options can intentionally hide differences. The result views are for inspection, not for merging or repairing documents.
Use Git Diff or another text-diff tool when indentation, object key order, or the exact lines in a patch are the subject of the review. For data in another format, use a parser or comparison tool designed for that format. If a document does not parse as JSON, check its syntax before relying on a semantic result.
Local processing and network boundaries
JSON parsing and comparison calculations run locally in your browser. Running a comparison does not upload your editor content. The editor saves input in the browser’s sessionStorage so it can survive navigation and reloads within the current tab session. This data is typically cleared when the tab closes, but leaving or reloading a page does not remove it; you can clear it through your browser’s site-data controls.
Optional features cross that local boundary:
- URL import sends a request from your browser to the source you specify.
- Share uploads the compared content to the share server for the retention period you select. Anyone who has the share link can view that content.
- URL query parameters are sent with page requests and may appear in hosting logs. Base64 encoding does not make sensitive data safe to place in a URL.
The Privacy Policy provides more detail about local storage, sharing, requests, and standard web logs.
Documentation and support
Start with Getting Started for the basic workflow. The documentation also explains array comparison methods, comparison options, the Git Diff view, and sharing results.
For questions, bug reports, or feature suggestions, contact [email protected]. Including a minimal reproducible example and the options you selected helps make a comparison problem easier to investigate; remove sensitive data before sending it.