Diff Checker
How to Use
Paste the original text on the left and the modified text on the right. The tool instantly compares them line by line and shows a unified diff view. Green lines are additions, red lines are deletions, and gray lines are unchanged.
How It Works
This tool uses the Longest Common Subsequence (LCS) algorithm to find the minimal set of changes between two texts. It compares line by line, identifying which lines were added, removed, or kept unchanged. This is the same fundamental approach used by tools like git diff and Unix diff.
Use Cases
- Code review: check your changes before creating a pull request to catch unintended modifications
- Config file changes: compare before-and-after versions of nginx.conf, docker-compose.yml, or similar files to spot errors
- Document revision tracking: compare contract or specification drafts to identify exactly which clauses or wording changed
- Data validation: compare CSV or JSON export results to verify data integrity
Reading the Diff
Lines with a green background are additions — text that exists only in the modified version. Lines with a red background are deletions — text that was removed from the original. Gray lines are unchanged context, shown to help you understand where changes occurred. The unified view shows additions and deletions in a single column, while side-by-side view places the original and modified text next to each other.
Tips for Better Diffs
- Normalize trailing whitespace and tabs in both texts before comparing to focus on meaningful changes only
- For unordered lists (like CSV rows), sort both texts before pasting to make the diff cleaner and easier to read
- Use side-by-side mode for long texts — it makes it easier to follow corresponding lines across both versions
Privacy
All comparison happens entirely in your browser. No text is sent to a server, stored, or logged. You can safely compare sensitive documents, configuration files, or source code.