Text comparison (diff)

Paste two versions of a text and find out what changed: added and removed lines are highlighted instantly. You can ignore case and whitespace. Everything happens in your browser: your texts are never uploaded to any server.

How to compare two texts

  1. Paste the original text into the box on the left.
  2. Paste the modified text into the box on the right.
  3. If you want, turn on "Ignore case" or "Ignore whitespace".
  4. Click "Compare" and review the added (+) and removed (−) lines below.
  5. Copy the result with the "Copy" button if you need it.

Frequently asked questions

Are my texts uploaded to a server?

No. The comparison happens entirely in your browser with JavaScript. Your texts are never sent to the internet.

How does it calculate the differences?

It compares line by line with a longest common subsequence (LCS) algorithm, the same principle used by tools like Unix diff or version control to align what stays the same and mark what was added and removed.

What do the + and − signs mean?

A line with + is a line that appears in the modified text (added) and a line with − is one that was in the original and is no longer there (removed). Lines without a sign did not change.

Can I ignore case or whitespace?

Yes. "Ignore case" treats "Text" and "text" as equal; "Ignore whitespace" ignores extra spaces at the start, at the end and between words. The result always shows your original lines.

Is it useful for comparing code?

Yes. It is ideal for seeing what changed between two versions of a code snippet, a configuration or any plain text. The comparison is line based.

Does it work offline?

Yes. Once the page has loaded, all the comparison happens locally, so it works without internet.