# Text Diff Checker

> Paste an old and a new version of any text or code and see which lines and which words changed, side by side or inline, with options to ignore case and whitespace and a unified diff you can copy.

- Page: https://codethatmoves.com/tools/text/text-diff-checker/
- Site: Code That Moves
- Category: Text tools
- Free, runs in the browser, nothing is uploaded
- Last checked: 2026-11-03

## What it does

- Line diff with Myers' algorithm, so the result is the smallest set of added and removed lines
- Changed words, or single characters, are marked inside a changed line, not only the whole line
- Open or drop a file into each side: text, Markdown, code, CSV or JSON, read on your device
- Side by side and inline views, with line numbers for both versions
- Ignore case, ignore whitespace or ignore trailing spaces; each side still shows the text as you pasted it
- Long unchanged runs fold away with three lines of context, and Previous and Next jump between changes
- Copy or download the result as a unified diff, the format of diff -u and git diff
- Linear-space Myers diff, so files of thousands of lines with thousands of changes are still matched line by line
- Swap the two sides in one click; the texts stay in your browser

## How to use it

1. Paste or open the old version in Original and the new version in Changed. A sample button fills both.
2. Read the counts of added, removed and unchanged lines, then scan the highlighted rows. Switch between side by side and inline.
3. Use Previous change and Next change to step through a long file, and switch to Characters to see a one-letter change in an ID or a number.
4. Turn on an ignore option when whitespace or capital letters are noise. Copy or download the unified diff to paste it into a review or a ticket.

## What it checks and why

A diff answers one question: what is the shortest list of edits that turns the first text into the second? The tool splits both texts into lines, finds the longest run of lines they share, and reports everything else as removed or added. It uses the algorithm from Eugene Myers' 1986 paper, the same family that diff and git use, so a line that moved is shown as a removal and an addition rather than guessed as a move. It runs the linear-space version of the algorithm from the same paper, which splits the problem at the middle of the edit path, so memory stays small even for long files with many changes.

When a removed line sits next to an added line, the two are compared again word by word. That is why a version number or one changed flag is marked inside the line instead of the whole line being painted red and green. Words are runs of letters and digits; spaces and punctuation are separate pieces. In character mode every character is a piece, which suits IDs, numbers and short strings.

The three ignore options change what counts as equal before the comparison. Ignore case treats Port and port as the same. Ignore whitespace treats any run of spaces and tabs as one space and drops the ones at the ends of a line. Ignore trailing spaces only drops the ones at the end. The text shown is always the text you pasted.

The unified diff output follows the format described in the GNU diffutils manual: a header with the two names, hunks that start with @@ -start,count +start,count @@, and three lines of context around each change. Lines starting with a minus were removed, lines starting with a plus were added.

## Specs and sources

- [Myers: An O(ND) difference algorithm and its variations (Algorithmica, 1986)](https://doi.org/10.1007/BF01840446)
- [GNU diffutils: Unified format](https://www.gnu.org/software/diffutils/manual/html_node/Unified-Format.html)
- [Git: git-diff documentation](https://git-scm.com/docs/git-diff)

## Limits

- Moved blocks are not detected. A paragraph moved to another place shows as removed in one spot and added in the other.
- Lines are the unit. Two texts with the same words but different line breaks will look very different; reflow them first if line breaks do not matter.
- Very large inputs that differ almost everywhere can exceed the work budget the browser is given; the rest of the changed middle is then shown as one removed and one added block, and the page says so.
- Word marks are skipped for lines longer than 2000 characters. A difference only in the final line break is reported in a note, not as a changed line. There is no merge or three-way view.
- Files are read as plain text. A Word or PDF file needs its text copied out first.

## Questions

### How do I compare two texts online?

Paste the old version in the left box and the new one in the right box. Added lines are green, removed lines are red, and the words that changed inside a line are marked more strongly.

### Is my text uploaded anywhere?

No. The comparison runs in your browser on your device, so contracts, code and drafts you paste are never sent to a server.

### Can I compare two files?

Yes. Use Open original file and Open changed file, or drop a file onto each box. Plain text, Markdown, code, CSV and JSON files are read in your browser and never leave your device.

### How do I compare two Word documents?

Copy the text of each document and paste it into the two boxes. The tool compares plain text, so formatting such as bold or fonts is not compared, only the words and lines.

### How do I ignore whitespace and capital letters?

Tick Ignore whitespace or Ignore case under the result heading. Lines that only differ in spacing or case are then counted as unchanged.

### What is a unified diff?

It is the text format used by diff -u and git diff, with a header, hunks and lines that start with a space, a minus or a plus. Copy it to paste into a pull request comment or to apply with a patch tool.

### Why is a changed line shown as removed and added?

A diff has only two kinds of edit, delete and insert, so a changed line is one deletion and one insertion. The tool puts them next to each other and marks the words that changed.
