Step-by-Step Workflow
Load Your Datasets
Upload or paste your "Original" and "Modified" JSON payloads into the configuration panels. Click the Compare JSON button to initiate the diffing engine.
Synchronized Split-View ️
Scroll through either the left or right pane. The tool perfectly synchronizes the scroll position of both viewports, ensuring the original and modified nodes remain flawlessly aligned horizontally, just like professional Git diff tools.
Analyze the Diff
The tool utilizes standard GitHub-style color coding to highlight changes:
Collapse and Expand
Click the + or - toggles to expand or collapse nested objects and arrays. Because both panes are bound to the same state engine, expanding a node on the left automatically expands its counterpart on the right to maintain visual symmetry.
Technical Specs & FAQs
Simultaneous O(N) Traversal
Instead of rendering two separate trees and attempting to diff them in the UI, a dedicated Web Worker (json-diff.worker.ts) walks both the Original and Modified JSON objects simultaneously. It recursively compares node types and values in a single pass, flattening the multi-dimensional objects into two linear 1D arrays to prevent main-thread freezing.
Dummy Node Injection
To maintain perfect horizontal alignment in a split view, both arrays must be the exact same length. When the algorithm detects that a key was added to the right side, it intentionally pushes a blank "Dummy Node" into the left array. The UI renders this dummy node as an empty, striped spacer, ensuring all subsequent nodes stay locked in vertical sync.
Dual Virtual Viewports ️
The UI utilizes two side-by-side Angular CdkVirtualScrollViewport components. Even if the diff generates 100,000 nodes, the DOM only ever renders the ~40 nodes currently visible on your screen. The components recycle DOM elements as you scroll, keeping memory consumption near zero.
Cross-Viewport Scroll Synchronization
Keeping two independent virtual scrollers aligned requires strict event management. The component binds to the native (scroll) events of both viewports. When the left pane scrolls, it programmatically updates the scrollTop of the right pane (and vice versa). To prevent an infinite event-triggering loop, a boolean locking mechanism (isSyncingLeft / isSyncingRight) intercepts and nullifies the echo events.