🔍 What is Code Diff?
Code Diff is a tool that visually shows differences between two pieces of code or text. Similar to Git diff, it displays added lines (green), removed lines (red), and unchanged lines with color coding. It is essential for code review, version comparison, merge conflict resolution, and before/after refactoring comparison. Uses the Myers diff algorithm (same as Git) to efficiently compare even large code files.
📊 View Modes
Unified View
Shows all changes sequentially in one column. Best for understanding overall flow
Split View
Shows original and modified side by side. Best for line-by-line comparison
💡 Use Cases
- Preview changes before Pull Request review
- Compare config files before/after library updates
- Compare text data like SQL queries, configs, API responses
- Compare two versions when resolving merge conflicts
Frequently Asked Questions
How is this different from Git diff?▼
Git diff shows file changes in a Git repository, while this tool compares any two texts directly. Useful in non-Git environments or for comparing non-file data.
Can it handle large code files?▼
Using the Myers diff algorithm, large files can be compared efficiently. Supports up to 50,000 lines.
Does it support character-level comparison?▼
Currently only line-level comparison is supported. For character-level comparison, use the Text Diff tool.