Text Diff
Articles, guides, and in-depth tips for the Text Diff — everything you need to get the most out of it.
✦ AI-powered — understands natural language
Why Git Merge Conflicts Occur Exactly Where They Do — Three-Way Merge, diff3, and Semantic Conflicts
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.