Skip to content
ToolZone

Text Compare

Highlight the differences between two blocks of text side by side, useful for spotting edits, reviewing document changes, or comparing drafts.

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 Compare

Text Compare checks two pieces of text against each other, one line at a time, and marks the lines that differ. Paste the original on the left and the edited version on the right; matching lines stay plain, while each changed line shows what was there before in red and what replaced it in green. It's a fast sanity check for lists, settings, and short documents.

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

Updated price list

A supplier sends a revised list of three items.

Input
Original: "Paper A4 - 4.99 / Toner - 39.00 / Pens - 2.50"; Modified: "Paper A4 - 4.99 / Toner - 42.00 / Pens - 2.50" (one item per line)
Result
Paper and Pens shown unchanged; "- Toner - 39.00" in red followed by "+ Toner - 42.00" in green

Inserted line

A new item is added at the top of a five-line list.

Input
Original: 5 lines; Modified: the same 5 lines with a new line inserted first
Result
All lines are reported as changed

Every line moved down one position, so each position now holds different text. Add new lines at the end, or compare sorted lists, to avoid this.

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
Comparison is exact and case-sensitive, including whitespace.
Privacy
Both texts are compared locally in your browser; nothing is uploaded or saved.

Frequently asked questions

Does this compare word by word?+

Lines are aligned first, then each changed line is compared word by word and the differing words are highlighted.

Can I use this to compare code instead of plain text?+

Yes. It uses the same engine as Code Diff, so inserted and deleted lines are handled correctly in code too.

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.

Is the comparison case-sensitive?+

By default yes. Tick Ignore case to treat "Apple" and "apple" as the same, and Ignore whitespace for spacing differences.

Is my text uploaded anywhere?+

No. The comparison runs in your browser and the text isn't sent to a server or saved.

Related tools