Skip to content
ToolZone

Text Diff

Compare two blocks of plain text line by line, highlighting additions, deletions, and changes between the original and revised versions.

Runs in your browser. Nothing you enter or upload leaves your device.

Original
Modified
Differences
Paste text in both boxes to compare

Keyboard shortcuts

Run the main action
⌘ / Ctrl + Enter
Copy the result
⌘ / Ctrl + Shift + Enter
Download the result
⌘ / Ctrl + S
Paste a file or image into file tools
⌘ / Ctrl + V
Search all tools
⌘ / Ctrl + K
Show these shortcuts
?

You can also drop files anywhere on the page.

About the Text Diff

Text Diff puts two versions of a text side by side and shows you, line by line, what changed between them. It is handy for writers checking an edited draft, developers comparing config snippets, and anyone who needs to spot a change without reading both versions word for word.

How it works

Both texts are split into lines and aligned with a longest-common-subsequence algorithm, the same idea behind git diff. It finds the largest set of lines the two versions share in order, so an inserted or deleted line shows up as a single change and the lines after it still match.

Within a block of changes, each removed line is paired with an added line and compared word by word, and the exact words that changed are highlighted. Options let you ignore whitespace or letter case, show only the changed lines with two lines of context, and switch between side-by-side and unified views.

How to use

  1. 1

    Paste or open the earlier version in Original, and the newer one in Modified.

  2. 2

    Read the result: removed lines in red, added lines in green, with changed words highlighted.

  3. 3

    Switch between Side by side and Unified, or tick Ignore whitespace, Ignore case or Only changes.

  4. 4

    Click Copy diff to copy the result with - and + markers.

Worked examples

One word changed in a list

You want to confirm which item in a shopping list was edited.

Input
Original: apple banana cherry Modified: apple blueberry cherry
Result
apple - banana + blueberry cherry

Lines 1 and 3 match, so only line 2 is flagged as a removal followed by an addition.

A changed config value

Comparing two copies of a small settings file.

Input
Original: port=3000 debug=false Modified: port=8080 debug=false
Result
- port=3000 + port=8080 debug=false

Inserting a line shifts the comparison

A new line is added near the top of a three-line text.

Input
Original: a b c Modified: a x b c
Result
a - b + x - c + b + c

Because lines are matched by position, an inserted line makes every following line look changed. Keep this in mind when comparing texts where lines were added or removed in the middle.

Limitations
Very large inputs (roughly 2,000 × 2,000 changed lines) fall back to a simpler comparison to stay fast. Moved blocks show as a deletion in one place and an addition in another; moves aren't detected separately. There is no syntax highlighting.
Assumptions
Both texts use line breaks to separate the units you want to compare. An empty line on one side and a missing line on the other are treated the same way.
Privacy
The comparison runs entirely in your browser, and the text you paste is not sent to a server or saved.

Frequently asked questions

Can this compare paragraphs of writing, not just code?+

Yes. It works on any plain text. For prose, you will get the clearest result if each sentence or paragraph sits on its own line in both versions.

Does whitespace affect the comparison?+

By default yes, but you can tick Ignore whitespace (and Ignore case) to treat lines that differ only in spacing or capitalization as the same.

Will an inserted line mark everything after it as changed?+

It shouldn't any more. Lines are aligned by content, not by position, so an inserted or deleted line shows as one change and the following lines still match.

Does it show which words changed inside a line?+

Yes. When a line changes, the specific words that differ are highlighted inside it, in both views.

Is my text uploaded anywhere?+

No. The diff is calculated in your browser and nothing you paste is sent to a server.

Related tools