Text Diff Checker
Compare two texts and highlight additions, deletions, and changes.
Text Diff Checker compares two blocks of text line by line, instantly showing what was added, removed, or unchanged — no server upload required.
How Text Diff Works
Myers Diff Algorithm
The Myers diff algorithm finds the shortest edit script — the minimum number of insertions and deletions — needed to transform one text into another. It runs in O((N+M)D) time where N and M are the line counts and D is the edit distance. This makes it fast even for large files, which is why Git uses it internally.
Reading the Output
Lines highlighted in green with a + prefix were added in the new version. Lines in red with a - prefix were removed from the original. Unchanged lines appear in grey in both columns. A summary shows the total count of added and removed lines.
Common Use Cases
Developers use diff tools to review code changes before committing, compare config files between environments, or verify that a refactor didn't accidentally alter behavior. Writers use them to track edits between document drafts. The tool works entirely in your browser — nothing is sent to any server.
Line-by-line diff using Myers algorithm (minimum edit distance) Frequently Asked Questions
Does this tool send my text to a server?
No. The entire diff is computed in your browser using JavaScript. Your text never leaves your device.
What does a line shown in red mean?
A red line with a - prefix was present in the original text but is missing from the new version — it was deleted.
What does a line shown in green mean?
A green line with a + prefix exists in the new text but not in the original — it was added.
Can I compare code files with this tool?
Yes. Paste the contents of any plain-text file — source code, JSON, config files, CSV — into both fields and the diff will highlight every changed line.
Why does the diff show many changed lines when I only changed one word?
The tool diffs line by line. If you edit a word in the middle of a paragraph that is all one line, the entire line shows as removed and re-added. Break long paragraphs into multiple lines for more granular results.
What is the formula for Text Diff Checker?
It uses the Myers diff algorithm: find the shortest edit script (minimum insertions + deletions) to transform text A into text B, computed as a path through an (N+M)-length edit graph with edit distance D.