JSON Diff
Compare two JSON values as a line diff of their stable two-space forms.
About this tool
Each side is parsed and reprinted with two spaces so the diff is about the data, not about a one-line paste versus a pretty paste.
The output marks lines. It is not a structural patch you can apply with another program.
How to use it
- Paste the first JSON value.
- Paste the second value.
- Compare. Both sides are parsed, then printed with two-space indentation before the diff.
Limitations
- Key order in each object follows the parsed order. The diff is of those reprints, not of the original spacing.
- Invalid JSON is reported. The page does not guess a trailing comma.
Pretty lines compared by index
Both sides are reprinted before any mark is chosen
Each box is parsed and printed with a two-space indent. The original spacing cannot create a difference, because both sides are printed before the compare. Number spelling is normalized by that print, so a decimal zero on one side and a bare integer on the other can become the same line. Duplicate keys have already collapsed inside each parse. Comments never enter the compare, because they cannot parse.
The compare walks line indexes. When the line at a given index is identical, it is copied with two leading spaces. When it differs, the left line is written with a minus if that side still has a line, and the right line is written with a plus if that side still has a line. This is not a longest-common-subsequence diff. An inserted key near the top shifts every following line, so later keys that did not change can still show as removed and added. A text-diff page that searches for a common subsequence will look calmer on that kind of edit. This page will not.
Key order is visible
Parsers keep the order they saw. Two objects with the same pairs in a different order pretty-print to different line sequences, and the index compare marks those lines. Semantically you may think of object key order as irrelevant. This output does not. If you want fewer noisy lines, put both documents through a step that sorts keys before you paste them, knowing that this page itself will not sort.
What the marks are not
A minus is a left line at that index, not a proven deletion of one property after a structural match. A plus is a right line at that index. There is no word-level highlight inside a long string. A one-character change in a long string makes that whole line a minus and a plus. Arrays show the same index effect: inserting one element near the start mis-aligns the rest. Use the output to spot a change in the printed form. Do not read it as a minimal patch a merge tool would emit.
Privacy
Your input is processed in your browser and is not uploaded to UtilChain. File names, text, and results are not sent to analytics.

