JSON Diff

Compares two JSON documents, ignoring key order and formatting.

JSON Diff compares two JSON documents and highlights the lines that were added or removed. Before comparing, it normalizes both sides by sorting object keys recursively and pretty-printing them, so differences in key order or formatting don't show up as changes. This makes it useful for spotting the structural differences between two JSON payloads, config files, or API responses.

Common uses

  • Compare two API responses to find which fields actually changed
  • Diff two versions of a JSON config file regardless of how they were formatted
  • Check whether two objects are structurally equal even when their keys are in a different order
  • Review changes in a JSON fixture or snapshot during testing
  • Verify that a JSON transformation or migration only changed the values you expected

FAQ

Is my data sent to a server?

No. The comparison runs entirely in your browser and nothing is uploaded. Both JSON inputs stay on your device.

Does key order affect the diff?

No. Both documents have their object keys sorted alphabetically before comparison, so two objects with the same keys in a different order are treated as identical.

Does formatting or indentation count as a difference?

No. Each side is re-serialized with consistent 2-space indentation before diffing, so whitespace, line breaks, and original indentation are ignored.

How are the differences shown?

The tool produces a line-by-line diff of the two normalized documents, marking lines as added or removed. It does not report a structured field-by-field summary.

What happens if my JSON is invalid?

Both inputs must be valid JSON. If either side cannot be parsed, the comparison cannot run, so make sure each document parses correctly first.

Related tools

  • CSV Diff
  • HTML Diff
  • List Compare
  • Text Diff
  • XML Diff
  • YAML Diff