How JSON diff works
Use Format & Sort Keys to canonicalize both payloads, then Compare Text treats the pretty-printed JSON as text with word-level highlighting. That combination catches field additions, type changes, nested object edits, and array item drift in webhook payloads, OpenAPI examples, and environment configs. Invalid JSON is flagged before formatting so you can fix syntax first instead of staring at a confusing half-diff.
Besoin d’un autre format ? Vous pouvez aussi compare text ou compare PDF files sans quitter compare-text.online.
Pourquoi les équipes l’utilisent
- One-click pretty-print and recursive key sorting
- Highlights added, removed, and modified JSON fields
- Works on minified or pretty-printed input
- Split and unified views for payload reviews
- Export a reviewable HTML or patch report
Comment utiliser cet outil
- 1
Paste both JSON payloads
Drop minified or pretty-printed JSON from an API client, log line, or fixture file into each pane. Large webhook bodies are fine as long as they are valid JSON.
- 2
Format and sort keys
Canonicalize both sides so object key order and indentation stop creating false positives. Nested objects are sorted recursively.
- 3
Review structural and value edits
Added keys, removed keys, type flips, and deep value changes light up in split or unified view. Jump between changes to brief a partner on exactly what broke.
- 4
Export or save the snapshot
Keep a browser history item for the incident, or export HTML / patch when you need an audit trail of the payload drift.
Why teams need a dedicated JSON diff
A generic text compare is enough for prose, but API payloads reshuffle keys, minify whitespace, and nest deeply. A JSON diff workflow that pretty-prints and sorts keys first removes cosmetic churn so reviewers see the semantic delta: a renamed field, a null that became a string, an array item that shifted, or a nested pricing object that grew a new tax field. That clarity matters when staging and production disagree, when a partner changes a webhook without a changelog, or when a migration script rewrites fixtures. JSON Diff on compare-text.online is built for that review loop — paste, canonicalize, brief the delta — without installing a desktop client or waiting on a CI artifact.
API payloads, webhooks, and OpenAPI examples
Capture a failing webhook from Stripe, GitHub, Shopify, or your own event bus and diff it against the last known-good body. Compare GraphQL responses when a schema change lands. Align OpenAPI examples with real traffic before you publish a partner doc. JSON Diff is also useful for mobile and edge clients that log compressed JSON — paste both sides, format once, and the redline becomes readable in seconds. Support engineers can attach an exported HTML report to the ticket so the partner sees the same highlighted fields you saw during triage.
Config, feature flags, and data migration checks
Infrastructure and app config often live as JSON or JSONC (strip comments first). Diff package manifests, launch-darkly style flag exports, and environment overlays before promotion. For data migrations, compare exported records or golden fixtures after a serializer or schema bump to prove the reshape did not drop required fields. When keys are intentionally unsorted for human editing, still run Sort Keys on a copy so the JSON diff stays honest. Keep a saved snapshot for each environment pair (dev vs staging, staging vs prod) so regressions are easy to reopen after the incident window closes.
Safety notes for secrets and PII
Visual comparison stays in your browser. Treat payloads with tokens, passwords, or customer PII carefully: redact before pasting when possible, avoid exporting reports to shared drives, and skip optional network features. Prefer fixture-sized samples over full production dumps whenever you only need to prove a field-level change. If you must paste production-shaped data, scrub identifiers and secrets first, then compare the structural skeleton that caused the bug.
JSON diff vs JSON schema validation
Schema validators answer “is this document legal?”. JSON Diff answers “what changed between these two legal (or almost legal) documents?”. Use both: validate first when syntax or required fields are in doubt, then JSON Diff to brief humans on the delta that caused a regression. Schema errors explain missing required keys; JSON Diff explains unexpected value drift inside keys that still validate.
Practical JSON diff checklist
1) Confirm both sides parse. 2) Format and sort keys. 3) Ignore pure whitespace noise by working on the pretty-printed output. 4) Walk added keys, removed keys, and type changes before debating value edits. 5) For arrays with unstable order, sort or fingerprint items upstream. 6) Export only what you need for the audit trail. Following this checklist keeps JSON Diff reviews short enough for standup and precise enough for partner escalations.
Cas d’usage courants pour json diff — comparer du json en ligne
API and webhook payloads
Diff staging vs production event bodies, Stripe or GitHub webhooks, and GraphQL responses when a partner changes a field name or nesting.
Infrastructure and app config
Compare package manifests, feature flags, and JSON configs before promoting a change across environments.
Data migration checks
Verify exported records or fixture files still match after a serializer or schema bump.
SDK and mobile client logs
Pretty-print two captured responses from QA devices to isolate which nested field diverged after a release.
Contract testing support
Compare expected vs actual JSON from consumer-driven contract tests when a failure needs a human-readable explanation.
OpenAPI example hygiene
Keep published examples aligned with live traffic by diffing documented samples against real responses.
FAQ JSON Diff — Comparer du JSON en ligne
- How do I compare two JSON files?
- Paste or upload both JSON documents, click Format & Sort Keys to normalize them, then review the highlighted JSON diff. Invalid JSON is flagged before formatting so you can fix syntax first.
- Why should I sort keys before a JSON diff?
- Many serializers emit keys in different orders. Sorting recursively removes that noise so the diff shows real value and structure changes instead of reshuffled lines.
- Can I diff minified JSON?
- Yes. Formatting expands minified payloads into indented JSON so nested objects are readable and line-level diffs stay useful.
- Is this JSON comparer safe for secrets?
- The visual comparison stays in your browser. Redact credentials when possible and avoid exporting reports that contain production secrets.
- Does JSON Diff handle arrays?
- Yes. Array items are compared in order after formatting. If item order is unstable, sort the arrays in your producer or compare a stabilized export.
- JSON diff vs text compare — which should I use?
- Use JSON Diff when you need pretty-print and key sorting. Use the homepage text compare for free-form prose, code, or already-canonical JSON.
- Can I compare JSON from API tools like Postman?
- Yes. Copy the response bodies from Postman, Insomnia, curl, or your gateway logs and paste them into each pane.
- What about JSONC or comments?
- Strip comments first so the document is valid JSON, then format and diff. Comment-only changes will not appear after stripping — keep a separate prose note if comments matter.
Outils de comparaison associés
Compare Text est un studio de diff gratuit sur compare-text.online. Passez à un autre comparateur sans quitter le site.