Text, Code & JSON Diff Checker
Compare two versions of code, text, configs, or JSON payloads side-by-side using exact LCS line diffing — with optional JSON key sorting and unified patch export.
| 1 | def two_sum(nums, target): | 1 | def two_sum(nums, target): |
| 2 | - for i in range(len(nums)): | 2 | + seen = {} |
| 3 | - for j in range(i + 1, len(nums)): | 3 | + for i, val in enumerate(nums): |
| 4 | - if nums[i] + nums[j] == target: | 4 | + need = target - val |
| 5 | - return [i, j] | 5 | + if need in seen: |
| 6 | + return [seen[need], i] | ||
| 7 | + seen[val] = i | ||
| 6 | return [] | 8 | return [] |
This diff engine is powered by the Longest Common Subsequence (LCS) DP algorithm — see it visualized step-by-step in our DSA Roadmap.
How Our Text, Code & JSON Diff Checker Works
Compare source code, configuration files, or minified JSON API responses side-by-side or in unified patch format — powered by exact LCS line diffing locally in your browser.
How do I compare two minified JSON responses with keys in different orders?
Check 'Format & Sort JSON Keys' in the toolbar. BigOSlate parses both JSON payloads, recursively sorts all object keys alphabetically, pretty-prints them, and highlights only real value differences.
What algorithm powers this diff checker?
It uses an exact Longest Common Subsequence (LCS) dynamic programming algorithm (similar to git diff) to align unchanged lines and highlight insertions (+) in green and deletions (-) in red.
Is it safe to compare private code or .env configs here?
Yes. Zero characters are uploaded to any server — all diff calculations run 100% client-side in your browser memory.
When should I use Split view vs Unified view?
Split (side-by-side) view is ideal on desktop for comparing full functions or JSON payloads; Unified view stacks old and new lines cleanly for narrow mobile screens or copying a Git-style patch.