Text Diff
Compare two blocks of text and highlight added, removed, and unchanged lines side by side.
Frequently Asked Questions
diff command. It finds the largest set of unchanged lines and marks the rest as added or removed.+) are present in the modified text but not in the original. Lines in red (prefixed with −) were in the original but removed. Unchanged lines are shown without color.git diff and the Unix diff utility.git diff --word-diff offer word-level highlighting on top of a line-level base.
git diff. Paste the old version on the left and the new version on the right to see added lines in green and removed lines in red — the same convention used by GitHub, GitLab, and Bitbucket pull request views.
git diff and diff -u) shows changes in a single output block: lines prefixed with - are removals, lines with + are additions, and context lines (unchanged) have no prefix. Hunk headers like @@ -1,5 +1,6 @@ indicate line number ranges. This tool uses a similar inline format with color coding instead of the @@ header syntax.
git merge, a three-way merge tool like Meld or KDiff3, or the diff/merge feature built into editors like VS Code or IntelliJ. This tool is best suited for quickly spotting changes, not for conflict resolution.
About This Text Diff Tool
This free text diff tool compares two blocks of text line by line and highlights additions, deletions, and unchanged lines — similar to the output of the Unix diff command. Differences are colour-coded for quick review, and all comparison happens in your browser.
Spotting exactly what changed between two versions of a file, config, or API response is faster with a visual diff than reading both versions in full. This is the same core operation used by version control systems like Git.
When to use this tool
- Comparing two versions of a config file, script, or document
- Spotting changes in an API response after a deployment
- Reviewing document revisions or draft iterations
- Identifying which lines differ between two data exports
Standards & References
How It Works
Paste Both Versions
Enter the original text in the left panel and the revised version in the right panel. The diff updates in real time as you type.
LCS Algorithm
The tool uses a Longest Common Subsequence (LCS) algorithm — the same basis as Unix diff — to identify the minimal set of added and removed lines.
Color-coded Output
Green lines are additions (+), red lines are removals (−), and neutral lines are unchanged. A summary shows total added/removed/unchanged counts.
Common Use Cases
Document Version Comparison
Compare drafts of contracts, reports, or articles to see exactly what changed between versions, without relying on tracked changes in Word.
Code Review
Quickly compare two versions of a configuration file, script, or snippet outside a full IDE, or before committing to version control.
Translation QA
Compare source and translated strings line by line to verify all segments are present and no lines were accidentally skipped or duplicated.
Editing & Proofreading
Show editors the exact changes made to an article draft. Line-level diff makes it easy to accept or reject individual changes.
Config File Auditing
Compare production and staging config files to find environment-specific differences that could cause deployment bugs.
Plagiarism Spot-check
Compare a submitted piece against an original source to find copied or lightly rephrased passages before publishing or grading.
Related Text Tools
Related Articles
View all articles
Why Text Diff Tools Work at Line Level (Not Character Level): Edit Distance, Granularity, and the Unified Diff Format
The simplest possible text diff — "what characters changed?" — is the Edit Distance problem, with an O(n×m) solution too slow for document-scale text. This is why practical diff tools work at line level, with a second character-level pass only within changed lines. Here's how granularity (character, word, line, sentence, structural) changes both what's shown and what's computationally feasible, the unified diff format explained, and why structured diffs for JSON/HTML need tree-level comparison rather than line-level.
How Plagiarism Detection Actually Works: From Exact-Match Shingling to Semantic Similarity, and Why Each Has Limits
Plagiarism-detection software doesn't search for "stolen sentences" — it converts text into mathematical representations (shingles, vectors, embeddings) and measures distance between them. Here's how exact-match shingling catches copy-paste-with-edits but misses paraphrasing, why semantic-embedding similarity catches paraphrasing but can't distinguish "copied" from "independently expressed similarly," and why similarity scores require human judgment to interpret.
Text Diff in Practice: Legal Redlining, Code Review, and How AI Writing Assistants Show Changes
Legal document redlining, Git pull request review, Word's Track Changes, and AI writing assistants all use the same diff principle. Here's how each context uses comparison differently, why legal diff needs more than plain text comparison, and how AI tools use diff to show suggested edits.
How Diff Works: Git, Three-Way Merge, and the Myers Algorithm Behind It
Git diff, pull request reviews, and three-way merges all run on the Myers diff algorithm. Here's how diff finds the shortest edit between two texts, how to read git diff output, why merge conflicts happen, and how diff applies beyond version control.
Text Diff — Compare Two Texts and See Exactly What Changed
Learn how text diff works, the difference between line, word, and character diff modes, how to read unified diff format, and when to use a text diff tool for documents, code, and configuration files.