๐Ÿ” Text Diff Checker

+0-0
Before
After
Result
Enter text in both boxes to see the diff

Compare two blocks of text and see added and removed lines highlighted. Useful for reviewing edits to a document, checking a code change, or spotting revisions in a contract or terms of service.

How to use

  1. Paste the original text into the "Before" box.
  2. Paste the text you want to compare it against into the "After" box.
  3. Review the diff, with added and removed lines highlighted.

How the calculation works

This tool splits both texts into lines and computes the difference by finding their longest common subsequence (LCS): the largest set of lines that appear in both texts in the same order. Lines in the LCS are shown as unchanged, lines only in the original as removed, and lines only in the revision as added. The calculation builds a table sized (lines before) ร— (lines after) and fills it from the end with the maximum number of lines that can still be matched โ€” a dynamic programming approach. Like the diff algorithms behind tools such as git diff, this aims to keep as many lines unchanged as possible. As a result, if you reorder lines, one copy shows as removed and the other as added.

Worked example

Before apple orange grape After apple banana grape Diff apple (unchanged) โˆ’ orange (removed) + banana (added) grape (unchanged) "apple" and "grape" remain in common, and you can see "orange" was replaced by "banana".

Things to be aware of

  • Comparison is line by line. If only part of a line changes, the whole line shows as removed and added.
  • Trailing whitespace differences count as different lines. If identical-looking lines show a diff, check the spaces.
  • Memory use grows with the product of the two line counts, so comparing tens of thousands of lines each can be slow.
  • Your text is processed in the browser and never sent anywhere.

FAQ

Does it show word-level or character-level differences?

It compares line by line, clearly highlighting which lines were added or removed.

Can it handle long documents?

Yes โ€” since everything runs in your browser, it can handle reasonably long text or code comparisons.

Is this useful for spotting changes in a contract or terms of service?

Yes โ€” paste the before and after versions to quickly surface exactly what was revised.

Can I use it to review a code change?

Yes โ€” even without a dedicated tool like git diff, pasting two versions of code lets you see the changes visually.

Is the text I compare sent to a server?

No, the comparison runs entirely in your browser and nothing is sent externally.