Skip to content
MoneyDeck

Text Diff Checker

Compare two texts and see exactly what was added or removed

Updated · Free, no signup

Differences

  Rent: $1,500
- Groceries: $450
+ Groceries: $520
  Utilities: $180
  Internet: $60
- Gym: $40
+ Streaming: $15

Summary

2 lines removed, 2 lines added, 3 lines unchanged

Added

2

Removed

2

Unchanged

3

Similarity

60%

  • The two versions are 60% similar by line.

Changes

Changed items

ChangeOriginal #Changed #Line
Removed2Groceries: $450
Added2Groceries: $520
Removed5Gym: $40
Added5Streaming: $15

About the Text Diff Checker

This diff checker compares an original text with a changed version and shows exactly what is different. In line mode every line is marked as unchanged, removed (−) or added (+), like a code review; in word mode the changes are shown inline, with removed words wrapped in [- -] and added words in {+ +}. A similarity percentage summarises how much of the text is shared.

Use it to check edits to a contract or essay, compare two versions of a configuration file, spot what changed in a policy or terms page, or verify that a copy-paste did not drop a line. You can ignore letter case and extra whitespace so that formatting-only changes do not clutter the result.

Everything runs in your browser; neither text is uploaded. The comparison uses a longest-common-subsequence algorithm, the same idea behind the Unix diff tool and Git, so it finds the smallest set of additions and removals that turns the original into the new version.

How to use the text diff checker

  1. 1Paste the original text in the first box.
  2. 2Paste the new or edited version in the second box.
  3. 3Choose whether to compare by line or by word.
  4. 4Turn on ignore case or ignore whitespace if formatting changes should not count.
  5. 5Read the marked-up differences and the similarity score.

Formula and method

Similarity = 2 × unchanged ÷ (items in original + items in changed) × 100

Both texts are split into items — lines, or words separated by whitespace. The checker finds the longest common subsequence (LCS): the longest list of items that appear in both texts in the same order. Items in the LCS are unchanged; items only in the original are removed; items only in the new version are added. Identical leading and trailing items are matched first to keep large, mostly-identical texts fast. To keep the page responsive, the detailed comparison is limited to a changed section of about 250,000 item pairs (roughly 500 × 500 changed lines); a larger changed section is shown as one removed block followed by one added block, with a note.

With "ignore whitespace" on, items are compared after trimming and collapsing runs of spaces; with "ignore case" on, they are compared in lowercase. The similarity score counts each unchanged item twice (once per text) out of all items in both texts, so identical texts score 100% and texts with nothing in common score 0%.

LCS
Longest common subsequence of lines or words

Worked examples

Monthly budget: two lines changed

Three lines (Rent, Utilities, Internet) match. The Groceries line changed, so the old line is removed and the new one added, and Gym was replaced by Streaming. Similarity is 2 × 3 ÷ (5 + 5) = 60%.

Word-level edit to a sentence

Word mode shows that "late" was inserted and "first" was replaced by "fifth". The 10 other words are unchanged, so similarity is 2 × 10 ÷ (11 + 12) ≈ 87%.

Case-only changes ignored

With "ignore case" switched on, the lowercase version matches the original line for line, so there are no changes and similarity is 100%.

Frequently asked questions

How do I compare two text files for differences?+

Open both files, copy the contents of the original into the first box and the new version into the second. The checker marks each line as unchanged, removed or added, and the table lists the line numbers of every change.

What do the + and − symbols mean?+

A line starting with "−" (minus) exists only in the original text and was removed; a line starting with "+" exists only in the changed text and was added. A modified line shows as a removal followed by an addition.

Should I compare by line or by word?+

Use line mode for code, lists, CSV data and configuration files where each line is a unit. Use word mode for prose such as contracts, essays and emails, where edits happen inside long paragraphs.

How is the similarity percentage calculated?+

It is twice the number of unchanged lines or words divided by the total number in both texts. For example, 3 matching lines out of 5 in each version gives 2 × 3 ÷ 10 = 60%.

Is my text uploaded anywhere?+

No. The comparison runs entirely in your browser, so you can safely compare confidential documents, source code or personal data without it leaving your device.

Related tools