Text Diff
See what changed between two versions — by line, word or character.
Or drop a file on the box. Nothing leaves your device.
Or drop a file on the box. Ctrl/⌘ + Enter compares.
Differences
About the Text Diff
Paste two versions of a text — a contract, an essay, source code, a config file, a list — and see exactly what changed. Removed parts are shown in red and added parts in green, and inside each changed line the words that differ are highlighted, so even a one-character edit stands out.
Compare by line for documents and code, by word for prose, or by character for short strings such as IDs and codes. Switch between side-by-side and unified views, jump from change to change, and download the result as a standard unified .diff or .patch file. The comparison runs in your browser, in a background thread, so long documents stay smooth and nothing is uploaded.
How to use it
- Paste the original text in the first box and the changed text in the second — or use Open file (or drag a file onto a box) for each.
- The comparison updates as you type. Choose Lines, Words or Characters, and Side by side or Unified.
- Tick Ignore case or Ignore whitespace to hide differences that do not matter, and Hide unchanged lines to fold long identical stretches.
- Step through the edits with Previous and Next (or press N and P in the results), then download the .diff or .patch file if you need one.
Examples
Original: Please send your comments by Friday. Changed: Please send your comments by Thursday.
--- original.txt +++ changed.txt @@ -1,1 +1,1 @@ -Please send your comments by Friday. +Please send your comments by Thursday.
Both texts end with a line break. In the on-screen views, only the words “Friday” and “Thursday” are highlighted.
Original: The quick brown fox Changed: The slow brown fox
The [−quick] [+slow] brown fox 1 word added · 1 word removed · 3 unchanged · 75% similar
Original: if (ready) {
Changed: if (ready) {No differences (ignoring whitespace).
Common uses
- Checking what a colleague changed in a contract, policy or article before you approve it.
- Comparing two versions of code or configuration and sharing the change as a patch.
- Spotting edits between drafts of an essay, a resume or a translation.
- Verifying that two exports, lists or log files really are identical.
Lines, words or characters?
- Lines compares whole lines, like
diffand code-review tools. Within each changed line, the words that differ are highlighted. - Words compares word by word and shows the changed text inline — best for prose, where one edit can re-wrap a whole paragraph.
- Characters compares every character (an emoji or accented letter counts as one), for short strings such as product codes or URLs.
Small unchanged fragments between edits are merged into the edit, so you see "replaced a b c with x y z" rather than alternating scraps.
Reading the results
Removed text has a red background and added text a green one; in the unified word and character views, removed text is also struck through and added text underlined. In the side-by-side view a hatched cell means the line does not exist on that side. With Hide unchanged lines on, long runs of identical lines are folded, keeping three lines of context around each change — select Show … unchanged lines to expand one.
The counts show how many lines, words or characters were added, removed and left unchanged. Similarity is 2 × unchanged ÷ (units in both texts): 100% means identical, 0% means nothing in common. Neither end is reached by rounding, so one edited line in a long document shows as, say, 99.96% or >99.99% rather than 100%.
The .diff and .patch download
The download is a unified diff, the format written by diff -u and read by patch tools and code-review systems. Lines starting with - were removed, + were added, and a leading space marks unchanged context (three lines around each change). A header such as @@ -4,2 +4,3 @@ means the section covers 2 lines from line 4 of the original and 3 lines from line 4 of the changed text.
To apply it to a copy of the original file, run patch original.txt < changes.diff. With Ignore case or Ignore whitespace on, lines that differ only in those ways are written as unchanged, like diff -u -i -w.
Limitations
- Moved blocks appear as a deletion in one place and an addition in another; moves are not detected.
- Very large or very different texts can take a few seconds. The comparison runs in the background and can be cancelled; it stops after 10 seconds, in which case line mode or smaller sections will work.
- Only plain text is compared. For Word or PDF files, copy their text into the boxes first.
- Windows (CRLF) and Unix (LF) line endings are treated as the same.
Privacy
Everything happens in your browser. What you enter or open here is not uploaded or stored by MySmartCoPilot.
Frequently asked questions
Is my text uploaded to a server?
No. Both texts stay in your browser; the comparison runs on your device and works offline once the page has loaded. That makes it safe for contracts, code and other private documents.
Can I compare two files?
Yes. Use Open file above each box, or drag a file onto it. Any plain-text file works — .txt, .csv, .md, .json, source code and more — up to 50 MB each, read on your device.
How do I ignore differences in spacing or capital letters?
Tick Ignore whitespace to treat runs of spaces and tabs as equal, ignore spaces at the start and end of lines and ignore added or removed blank lines. Tick Ignore case to treat capital and small letters as the same.
What does the similarity percentage mean?
It is twice the number of unchanged units divided by the total number of units in both texts, counted in lines, words or characters depending on the mode. Identical texts score 100%.
Can I apply the downloaded patch?
Yes — it is a standard unified diff. Run patch original.txt < changes.diff on a copy of the original file to turn it into the changed version.