Text Diff
Text diff is a text tool that compares two blocks of text and highlights every addition and deletion between them. It runs a word-level longest-common-subsequence algorithm, color-codes the result, and works on prose, code, JSON, or any plain text. The tool runs in your browser.
Original
Drop a text file or click to choose
Updated
Drop a text file or click to choose
+ 0 added− 0 removed= 0 unchanged
Paste text in both panes above to see the diff.
Dedicated pages
Optimised for specific diff workflows.
How to compare two texts
- Paste the original text into the left panel.
- Paste the new or modified text into the right panel.
- Differences are highlighted automatically, additions in green, deletions in red.
- Scroll through the diff to review all changes between the two versions.
Common uses
- Comparing two versions of a document to find what changed, then counting words and characters to see how the length shifted between versions
- Reviewing edits to a configuration file or code snippet
- Checking whether two text outputs are identical or where they differ. A SHA-256 checksum can quickly confirm two files are byte-for-byte identical
Technical specification
- Algorithm or formula: Word-level Longest Common Subsequence (LCS) algorithm. Inputs are tokenised into words and whitespace, then matched against the other side; tokens absent from the matching are flagged as insertions or deletions.
- Browser API or library: Custom LCS implementation executed in a dedicated Web Worker so the UI stays responsive for large inputs.
- Input limits: No hard cap; tested with paired inputs up to ~500 KB each. Diff complexity scales with token count, so very large inputs take seconds.
- Output: Inline highlighted diff with additions in green and deletions in red, plus an aggregate count of added and removed tokens.
- Known limitations: Word-level granularity (not character or line) means single-character changes within a word render as a full-word change.
Frequently asked questions
- Is my text sent to a server?
- No. The diff algorithm runs entirely in your browser.
- What diff algorithm is used?
- The tool uses a character-level or word-level diff algorithm similar to Unix diff. Changes are shown inline with colour highlighting.
- Can I compare code files?
- Yes. Paste code into either panel. The tool handles any plain text content including code, JSON, XML, and prose.
- Is there a size limit?
- There is no hard limit. Very long texts may take a moment to diff but will complete in-browser without uploading anything.
Reviewed and tested May 26, 2026.