Git Diff View
Switch the result page to a Git Diff view that shows line-by-line text differences.
The result page offers two answers to different questions. Data Compare asks whether the parsed JSON values differ under the selected comparison rules. Git Diff asks which lines of the original input text differ. Using both can separate a real data change from reformatting or key reordering.
Open Git Diff
- Enter the Base and Contrast JSON documents and run a comparison.
- On the result page, use the view control in the top toolbar to switch from Data Compare to Git Diff.
- Review the original Base text on the left and Contrast text on the right in the side-by-side diff editor.
Git Diff is read-only. Return to the editors to change either input. To change semantic comparison options, switch back to Data Compare, where the Settings control is available.
Why the views can disagree
| Question | Data Compare | Git Diff |
|---|---|---|
| What is compared? | Parsed JSON values and structure | The original text entered in each editor |
| What do options affect? | Array matching, case handling, and numeric-string equivalence | The displayed text diff is not rewritten by these semantic options |
| Do indentation and line breaks matter? | No | Yes, when they change the text |
| Does object key order matter? | No | Yes, because the keys occur on different text lines or positions |
| Does array order matter? | It depends on the selected array method | Reordered text can appear as a textual change |
| What is the result useful for? | Explaining a value, type, key, or array difference | Locating exact source-text edits and formatting changes |
For example:
Base
{
"name": "catalog",
"enabled": true
}
Contrast
{"enabled":true,"name":"catalog"}
Data Compare finds no semantic difference: the objects contain the same keys and values. Git Diff shows text changes because the indentation, line layout, and key order changed. Neither result contradicts the other; they describe different representations.
The reverse can also happen. If Numeric String Equals Number is enabled, Data Compare can treat these values as equal:
{"port": 8080}
{"port": "8080"}
Git Diff still shows the quotation marks as a text change. Similarly, case-insensitive options can suppress a semantic difference without removing it from Git Diff.
Interpret each view correctly
Use Data Compare when you need to know what changed in the data: a deleted configuration key, a boolean that became false, or an array entry that no longer matches. Its result paths and difference types are usually more actionable than a changed line number.
Use Git Diff when you need to audit the exact submitted text: a whitespace-only edit, a moved object key, a changed quote, or a reformatting that should be kept out of a data-focused review. It compares the text as entered rather than a normalized or pretty-printed reconstruction.
Array results require particular care. Git Diff always sees textual reordering, while Data Compare follows the selected array comparison method: By Index and LCS remain order-sensitive, and Unordered compares multisets with duplicate counts. Switching to Unordered does not remove reordering from Git Diff.
The name “Git Diff” describes the familiar side-by-side presentation. It does not compare commits, branches, or repository history; it compares the two current input texts. Although the display is textual, the result page is reached through JSON comparison, so invalid JSON must be corrected before the comparison can complete.
A practical review sequence
- Start in Data Compare. Select options that reflect the data contract, not options that merely make the diff smaller.
- Inspect the reported paths. Confirm that added and deleted array elements are aligned as intended, especially when objects have changed.
- Switch to Git Diff for unexplained noise. Look for formatting, key order, or other raw-text edits that do not represent semantic changes.
- Return to Data Compare after changing settings. Git Diff continues to show the original text and should not be used to verify that a semantic option had an effect.
Troubleshooting
Git Diff shows changes, but Data Compare reports none. Check formatting and object key order first. Then review enabled case-handling and numeric-string options. If only array order changed, check whether Unordered is selected.
Data Compare shows many array changes after one insertion. The text view cannot tell you which array alignment is appropriate. Try LCS when order matters and existing elements should remain matched across an insertion; use By Index when positions themselves are significant.
An expected text change is absent from Data Compare. Data Compare is not a spelling-and-formatting check. It intentionally ignores presentation that does not alter the parsed value, and enabled options can also make distinct text representations semantically equal.
The settings control is not visible in Git Diff. Switch to Data Compare to change comparison options. Git Diff remains a read-only view of the original input text.