Diff Checker
Compare two texts and see the differences highlighted. Additions in green, deletions in red. Everything runs in your browser — no data is sent anywhere.
How it works: Paste or type text in both panels below. The tool compares them line by line and highlights additions (green), deletions (red), and unchanged lines (gray). Toggle options to ignore whitespace or case differences. No data is sent to any server.
What is a Diff?
A diff (short for difference) is a comparison between two pieces of text that shows what has changed. Diff tools identify added, removed, and modified lines, making it easy to see exactly what changed between two versions of a file. Diffs are fundamental to version control systems like Git, code review processes, and document comparison workflows.
How Diff Algorithms Work
Diff algorithms find the Longest Common Subsequence (LCS) between two texts to determine the minimum set of changes. The most common algorithms are Myers' algorithm (used by Git) and the patience diff algorithm. Lines present in the original but not the modified text are marked as deletions, while new lines are marked as additions. Unchanged lines provide context.
Common Use Cases
Diff tools are used for comparing code versions before commits, reviewing pull request changes, comparing configuration files between environments, finding changes in documentation, debugging by comparing working vs broken code, and verifying that formatting changes don't alter content. They are essential in any collaborative development workflow.
Diff Best Practices
- Review diffs before committing to catch unintended changes
- Use ignore-whitespace when comparing reformatted code
- Compare against the base branch, not just the previous commit
- Keep diffs small and focused — smaller changes are easier to review
- Use side-by-side view for complex changes
- Pay attention to context lines around changes for full understanding