Text Diff
Compare two texts side by side and see every addition, deletion, and unchanged line highlighted
Paste text in both panels and click Compare — or just start typing
What is Text Diff?
A text diff tool compares two pieces of text and shows you exactly what changed — which lines or words were added, removed, or left untouched. The concept originates from the Unix diff utility and the Myers diff algorithm, now used by virtually every version control system in the world.
Common use cases include comparing two versions of a document, reviewing code changes before a commit, spotting differences between copied and pasted content, verifying edits made by a collaborator, and reconciling config files or SQL scripts.
How the algorithm works
This tool uses an LCS (Longest Common Subsequence) algorithm to find the longest sequence of lines (or words, in word-diff mode) that appear in both texts in the same order. Everything outside the LCS is classified as a deletion from the original or an insertion in the modified version. The result is rendered as a colour-coded side-by-side view with line numbers.
How to Use the Text Diff Tool
- Paste your original text into the left panel labelled "Original".
- Paste the modified version into the right panel labelled "Modified".
- Click "Compare" (or just type — the diff updates automatically after a short pause).
- Read the colour-coded side-by-side output: red highlights show deleted lines on the left, green highlights show added lines on the right, and unchanged lines appear in both columns.
- Switch to Word diff mode to see individual word-level changes within each modified line.
Frequently Asked Questions
Related Tools
100% Private & Secure
All diff processing runs locally in your browser. Your text is never uploaded to any server, making this tool safe for confidential documents, proprietary source code, or any sensitive content.