Text Diff Checker (Compare Two Texts)

Paste the original and the changed text. Added and removed lines are marked, and nothing leaves your browser.

Runs in your browser — nothing you enter is uploaded

Text Diff Checker

All fields are required unless marked “optional”.

Tip: press Ctrl+Enter (Cmd+Enter on Mac) inside a text box to run.

Your result will appear hereFill in the fields and press “Compare”.

Formula

  • diff = the shortest set of added and removed lines that turns the original into the changed text
  • similarity = 2 × unchanged lines ÷ (lines in both texts)
  • Found with a longest-common-subsequence comparison of whole lines

Lines the two texts share are kept; everything else is shown as removed or added.

Worked example

A small list

Original text
apple banana cherry date
Changed text
apple blueberry cherry date elderberry
Show
Changes with 2 lines of context
Ignore whitespace differences
No
Ignore upper/lower case
No

Result

2 lines added, 1 removed

Lines added: 2

Lines removed: 1

Lines unchanged: 3

  apple
- banana
+ blueberry
  cherry
  date
+ elderberry

How it works

A diff finds the lines the two texts have in common and marks everything else: lines only in the original are shown as removed with a minus sign, and lines only in the changed text as added with a plus sign. It uses a longest-common-subsequence comparison of whole lines, which gives a minimal list of changes.

An edited line appears as one removed line plus one added line, because the comparison works at line level. Tick the options to ignore differences in spacing or letter case when you only care about content. By default only the changed lines and two lines of context around them are shown, with … between separate groups; choose Everything to see the full text. Each side can have up to 2,500 lines.

The comparison runs in your browser and nothing is uploaded, so it is safe for configuration and code. To compare structured data, format it first with the JSON Formatter; to hash two files for a quick equality check use the Hash Generator, and for pattern matching across text try the Regex Tester.

Assumptions and limits

  • Line-by-line comparison only; changes inside a line are not highlighted.
  • Up to 2,500 lines per side.