Text Diff Checker: Compare Two Texts by Line, Word or Character

Compare two texts by line, word or character with side-by-side or unified view, ignore whitespace and case options, and a copyable unified patch.

Runs in your browser. Nothing is uploaded.

Text

Text Diff Checker

Original

Modified

Compare

Paste text in both boxes. The differences appear here as you type, with +/- markers as well as colour.

Example

Input
Original:
Dear team,
The release is on Friday.
Thanks,
Asif

Modified:
Dear team,
The release is on Monday.
Please review the notes.
Thanks,
Asif
Result
--- original
+++ modified
@@ -1,4 +1,5 @@
 Dear team,
-The release is on Friday.
+The release is on Monday.
+Please review the notes.
 Thanks,
 Asif

Three levels of comparison

Paste the original on the left and the changed text on the right. Line mode compares whole lines and is the right choice for code, configuration, logs and lists. Word mode marks only the words that changed inside a paragraph, which suits prose, contracts and documentation. Character mode marks single characters, useful for spotting a typo in an identifier or a changed digit. Character mode compares what a reader sees as one character, so an emoji or an accented letter is never cut in half.

The result can be read side by side, with the original and the modified text next to each other, or as one unified column. Removed text is struck through and added text is underlined, and line views carry a minus or plus marker, so the differences do not depend on telling red from green. Long unchanged stretches are folded to a few lines of context; one switch shows everything.

Options and the unified patch

Ignore whitespace treats lines (or, in word and character mode, whitespace) that differ only in spaces, tabs or line breaks as equal, which hides indentation and wrapping noise. Ignore case makes Hello and hello equal. Line endings are normalised, so a file saved with Windows CRLF compares cleanly against one with Unix LF, and a missing final newline is not reported as a change.

The copy button produces a unified patch, the format printed by diff -u and git diff: two header lines and hunks that start with @@ -start,count +start,count @@, followed by lines prefixed with a space, a minus or a plus, with three lines of context. Paste it into a ticket, a code review comment or a chat. When whitespace or case is ignored, the patch describes the lines as they appear in the modified text.

How it works and its limits

The comparison uses the jsdiff library, an implementation of the Myers O(ND) algorithm from 1986 that finds a shortest set of insertions and deletions. It runs in your browser and nothing is uploaded. Before the algorithm runs, the identical start and end of the two texts are cut off, which makes the common case of a small edit in a big file instant.

Very large inputs are handled in chunks: word and character mode first compare by line and then look inside only the changed blocks. If two huge texts are almost entirely different, the algorithm would take too long, so after a time limit the tool shows the affected block as replaced as a whole and says so. A diff finds a minimal edit, not the edit a human would call a move: moved paragraphs appear as a removal and an addition.

Frequently asked questions

What is the difference between line, word and character diff?

Line mode marks whole lines, word mode marks changed words inside text, and character mode marks single characters. Use lines for code and lists, words for prose, characters for typos.

Why is a moved paragraph shown as removed and added?

Diff algorithms find the smallest set of insertions and deletions, and they do not track moves. A moved block therefore appears once as removed and once as added.

Can it compare Windows and Unix line endings?

Yes. CRLF, LF and CR are all treated as line breaks, so files that differ only in line endings are reported as identical.

What is a unified diff?

The text format of diff -u and git diff: a header, then hunks marked @@ -a,b +c,d @@ with lines starting with a space (unchanged), minus (removed) or plus (added).

Are the texts uploaded?

No. The comparison runs in your browser.

Related tools