Paste the "original text" or "old version" into the left input box, and the "modified" or "new version" into the right input box. Click "Compare" and the tool will compare both texts line by line, highlighting differences in color: green for added lines, red for deleted lines, and yellow for modified lines.
The statistics panel shows counts for added, deleted, modified, and identical lines, plus a similarity percentage. Higher similarity means the texts are closer. Click "Clear" to reset both inputs for the next comparison.
This tool supports an option to ignore whitespace, automatically skipping leading, trailing, and newline differences to focus on actual content changes. This is especially useful when comparing code before and after formatting.
Text diff tools are indispensable for programmers. During code review, they let you quickly see changes between versions to confirm modifications are correct. When version control systems (like Git) are unavailable, this tool serves as an effective temporary substitute.
Editors and writers also benefit. Editors can compare author revisions before and after; students can compare different essay drafts. In legal and business contexts, comparing revised contract versions helps quickly locate clause changes.
Text difference algorithms typically use the Longest Common Subsequence (LCS) algorithm or its variants. This dynamic programming approach finds the longest identical subsequence between two texts to determine the optimal edit path (add, delete, replace). Time complexity is typically O(n×m), where n and m are the lengths of the two texts.
Beyond LCS, modern diff tools use optimized strategies like Myers' algorithm for better performance with large texts. In the code domain, diff algorithms can also consider syntax structure rather than just line-level comparison (e.g., tree-sitter syntax tree diff). This tool uses line-level comparison, which is simple, intuitive, and suitable for most everyday scenarios.