Text Diff
Compare two texts and see highlighted differences. Find additions, deletions, and changes between text versions.
Online text comparison: catch every difference
Why use a text comparison tool?
Spotting changes across multiple document versions by hand is slow and error-prone. An automated diff scans every line in milliseconds and ensures you miss nothing, even on files exceeding 5,000 lines.
This tool uses the LCS (Longest Common Subsequence) algorithm, the same approach behind Git. It finds the longest common subsequence between your two texts, then labels each line as an addition (green), deletion (red), or unchanged.
All processing runs entirely in your browser. No data is sent to any server: your contracts, source code, and confidential documents stay on your machine.
Who uses this tool?
- Developers
- Compare two versions of a source file (JavaScript, Python, HTML, CSS) before committing. View additions and deletions with line numbers, just like a git diff in the browser.
- Writers and editors
- Track revisions between two drafts of an article, report, or contract. Spot added, deleted, or reworded sentences at a glance without installing any software.
- Translators
- Compare the source text and translation to verify that no passage was omitted. Paste the original on the left and the translated version on the right for a quick check.
- Students and researchers
- Check the changes between two versions of a thesis or research paper. Confirm that the corrections requested by your advisor have been properly applied.
How does the comparison work?
Paste your original text in the left field and the modified text in the right field, then click "Compare." The tool accepts any plain text: prose, code, CSV data, server logs.
The result displays each line color-coded: green for additions, red for deletions, and no color for identical lines. Line numbers from both versions appear side by side.
A summary shows the count of additions, deletions, and unchanged lines, letting you quickly gauge the scope of changes between your two versions.
Frequently asked questions
- How does the text comparison algorithm work?
- The tool uses the LCS (Longest Common Subsequence) algorithm to find the longest common subsequence between your two texts. It then compares line by line and classifies each line as an addition, deletion, or unchanged. This is the same method used by Git and professional diff tools.
- Is my text sent to a server?
- No. The entire comparison runs in your browser via JavaScript. No data is transmitted, stored, or logged on any server. Your documents stay strictly on your machine.
- What is the maximum text size I can compare?
- There is no server-side limit since processing is local. The only constraint is your browser's memory. In practice, the tool handles texts of several thousand lines comfortably. Beyond 10,000 lines, computation time may increase depending on your device.
- Can I compare source code with this tool?
- Yes. The tool compares any plain text, including source code (JavaScript, Python, HTML, CSS, etc.). It displays additions in green and deletions in red with line numbers, exactly like a Git diff.