Code Diff Visualizer
Side-by-side code diff with syntax highlighting, line numbers, and statistics.
Original Code
Modified Code
Usage
This tool compares two code snippets using the Longest Common Subsequence (LCS) algorithm to highlight line-level differences.
Features
- Side-by-side input for original and modified code
- Highlighted diff: green for additions, red for deletions
- Line number mapping between old and new code
- Statistics for added, removed, and changed lines
- @@ markers to group diff sections
Steps
- Paste the old version code into the left "Original Code" box
- Paste the new version code into the right "Modified Code" box
- Click "Sample" to load example code for a quick demo
- Diff results appear in real time in the comparison area below
- Check the statistics card for an overview of changes
Notes
- Diff is line-level only; character-level diff is not supported
- Large files may take time; recommended under 1000 lines
- Whitespace differences are treated as different lines
- All computation runs locally in your browser; code is not uploaded