Text Diff Checker

Paste an original and a changed version to see exactly what was added and removed. Compare by lines for code and configuration files, by words for prose, or by characters for small edits.

How to use the Text Diff Checker

  1. Paste the original text on the left and the changed text on the right.
  2. Choose Lines, Words or Characters. Lines mark whole lines with + and -, while Words and Characters highlight inside the text.
  3. Tick Ignore case or Ignore whitespace to skip differences you do not care about, such as indentation.
  4. Use Swap to reverse the comparison and Copy diff to take the result with you. Added parts are marked [+ +] and removed parts [- -] in the copied text of word and character diffs.

How the comparison works

The tool finds the smallest set of insertions and deletions that turns the original into the changed text, using Eugene Myers' 1986 algorithm, the same idea behind git diff. It compares sequences of lines, words or characters, so the result is the shortest edit script, not just a list of different lines.

A moved block of text appears as a deletion in one place and an addition in another, because the algorithm compares in order and does not detect moves. Very different texts can need a huge number of edits; beyond a limit the tool shows the changed section as one full replacement instead of freezing your browser.

Choosing a mode and options

Line mode suits code, logs, JSON and configuration. Word mode suits documents, where a one-word change should not mark a whole paragraph. Character mode shows typos and small edits. Ignore whitespace trims and collapses spaces in lines, treats any run of whitespace as equal in words, and skips whitespace characters in character mode.

Frequently asked questions

Is my text uploaded when I compare it?

No. The comparison runs in your browser and nothing is sent to a server.

Why is a changed line shown as removed and added?

A diff has only two kinds of change, insertion and deletion. A modified line is a deletion of the old version and an insertion of the new one. Use Words mode to see which words changed inside the line.

Is there a size limit?

Yes, about 400,000 characters in total, so the page stays responsive. For larger files use a command-line tool such as git diff or diff.

Does it detect moved lines?

No. A moved block is shown as removed from the old position and added at the new position.

How are different line endings handled?

Windows (CRLF), Unix (LF) and old Mac (CR) line endings are all treated as a line break, and a single trailing newline is ignored.