Text Tools
Diff checker: compare two texts.
Paste two versions of a text and see exactly what changed. Compare by line, word or character, side by side or inline, ignore case or whitespace, and copy the result as a unified diff.
Inputs
Diff result
Paste both texts, then press Compare. Or press Load example to see how it works.
How this diff checker works
A diff checker finds the smallest set of additions and deletions that turns text A into text B, then marks everything else as unchanged. This one splits each text into lines, words or characters (your choice), aligns the two sequences with the Myers O(ND) difference algorithm, and highlights what was removed from A and what was added in B. It is the same family of algorithm behind the diff command and most code review tools, running in your browser.
Line, word or character: which should you pick?
- Line is the standard diff view. Use it for code, configuration, lists and anything where a whole line is the unit. In side-by-side view, a line that was edited is paired with its replacement and the changed words inside it are highlighted.
- Word suits prose: contracts, essays, articles, copy edits. Punctuation marks count as their own words, and line breaks are treated as whitespace between words.
- Character shows exactly which letters changed, such as a typo, a swapped digit or a stray space. Characters are counted as visible units, so an accented letter or an emoji counts once.
What the options do
- Ignore case: Hello and hello compare as equal.
- Ignore whitespace: in line mode, spaces and tabs at the ends of a line and repeated spaces inside it are ignored. In word and character mode, all whitespace is left out of the comparison.
- Treat equivalent Unicode forms as equal: a letter such as é can be stored as one character or as e plus a combining accent. They look identical but are different data, so by default they show as a difference. Turning this on compares them in Unicode Normalization Form C so they match.
- Line endings: Windows (CRLF), classic Mac (CR) and Unix (LF) line endings are never reported as differences. If the two texts use different endings the tool tells you.
- A final newline at the end of a text does not count as an extra empty line.
Reading the result
Added, Removed and Unchanged are counts of lines, words or characters, depending on the mode. A line that was edited counts as one removed line and one added line, as in a standard diff. In word mode, spaces are not counted as words.
The unified diff view, and the Copy unified diff button, produce patch-style text: a --- and +++ header, then hunks that start with @@ -start,count +start,count @@ (only the start appears when a hunk has a single line). Lines beginning with a space are unchanged context, - marks a line removed from A, and + marks a line added in B. It uses 3 lines of context and always compares by line, whatever mode is selected.
Limits
Very large, mostly different texts are expensive to align exactly. If the number of edits needed goes past 3,000, the tool stops looking for a shorter alignment, shows the changed middle section as one block removed and one block added, and says so in a notice. Identical text at the start and end is always matched first, so large files with a few edits are fast.
Need a comparison for something other than prose? For lists, see Compare Two Lists and Find Unique Lines. For structured data, JSON Diff ignores key order and whitespace.
Sources
- Myers, E. W. (1986). An O(ND) Difference Algorithm and Its Variations. Algorithmica 1, 251-266
- GNU Diffutils manual: Detailed description of unified format
- Unicode Standard Annex #15: Unicode Normalization Forms
- MDN: Intl.Segmenter (grapheme splitting for character mode)
Algorithm paper, GNU Diffutils manual (version 3.12), Unicode normalization annex and MDN reference retrieved October 2026. Where a browser does not support Intl.Segmenter, character mode splits by Unicode code point instead.
Worked example: reading a diff
Press Load example in the tool, or paste these two versions. Text A has five lines and text B has six:
A B
The quick brown fox The quick red fox
jumps over the lazy dog. jumps over the lazy dog.
Ship date: March 3 Ship date: March 10
Owner: Dana Owner: Dana
Status: draft Status: draft
Reviewed by: Sam
In line mode the counts are 2 removed, 3 added and 3 unchanged. Two lines were edited (each counts as one removed plus one added, exactly as a standard diff counts them) and one line, Reviewed by: Sam, is new. The unified diff is a single hunk headed @@ -1,5 +1,6 @@: it starts at line 1 of A and covers 5 lines, and starts at line 1 of B and covers 6. The lines -The quick brown fox and +The quick red fox are the first change, -Ship date: March 3 and +Ship date: March 10 the second, and +Reviewed by: Sam the addition. Run the same example in word mode and only the words that differ are highlighted, which is easier to read than two whole changed lines.
Who uses a text diff, and for what
- Writers and editors compare a draft with an edited copy to see exactly what an editor changed when tracked changes were not used.
- Contract and policy reviewers compare version 1 with version 2 of a document that arrived without a redline. Use word mode, and turn on Ignore whitespace if reflowed line breaks are making the result noisy.
- Developers and sysadmins compare configuration files, copied logs or SQL, then copy the unified diff into a ticket or a patch.
- Students and teachers check a submission against a source or compare two versions of a reading.
- Anyone debugging "identical" text that does not match: character mode and the Unicode option reveal invisible differences such as a non-breaking space or a decomposed accent.
Choosing the right options
If the result looks like every line changed, the cause is almost always whitespace or line endings, not content. Try Ignore whitespace first. Git has the same idea: its -b option ignores changes in the amount of whitespace and its -w option ignores whitespace altogether, and git also offers a word-level diff for prose through --word-diff, which marks removed words as [-removed-] and added words as {+added+}. Use Ignore case when capitalisation is irrelevant, such as comparing two lists of names. Leave both off when the exact bytes matter, for example when checking that a generated file matches its template.
What a diff cannot tell you
A diff is a minimal edit script between two sequences, not a judgement of meaning. If a paragraph moved from the top of a document to the bottom, the diff reports it as removed in one place and added in another. If two sentences are reworded but mean the same, the diff still marks all the changed words. The algorithm also does not guarantee the most readable result: several different edit scripts can be equally short, and the tool picks one. For structured formats, compare the structure rather than the text; the JSON diff ignores key order and whitespace, which a plain text diff cannot. To compare two lists regardless of order, use Compare Two Lists, and to remove repeated entries from one list first, use Remove Duplicate Lines.
How the unified diff format works
A unified diff begins with two header lines naming the old and new file, then one block per changed region, called a hunk. Each hunk starts with a header of the form @@ -old_start,old_count +new_start,new_count @@, followed by the lines themselves: a leading space for unchanged context, - for a line only in the old version and + for a line only in the new one. Three lines of context is the default in Git and in the diff command, which is what this tool uses. A tool that applies patches, such as patch or git apply, uses the line numbers and the context to find where each change belongs, so the copy output can be saved as a .patch file once you replace the placeholder file names with real ones.
Privacy and good practice
The comparison happens in your browser and the text is not sent to a server. Even so, treat the page like any web page: do not paste passwords, private keys or personal data you would not put in a browser, and clear the boxes when you finish on a shared computer. For very large inputs, compare section by section; the page stops looking for a shorter alignment once it needs more than 3,000 edits and says so in a notice.
Diff checker FAQ
How do I compare two texts online?
Paste the original into box A and the changed version into box B, then press Compare. Removed text is shown in red with a strikethrough and added text in green with an underline. Switch between line, word and character comparison, and between side-by-side, inline and unified views, without losing your text.
How do I find the difference between two texts?
Pick the unit that matches what you are looking for. Line mode finds changed lines, word mode finds changed words in prose, and character mode finds single-letter typos. The counts above the result show how many items were added, removed and left unchanged.
Does it treat Windows (CRLF) and Unix (LF) line endings as differences?
No. CRLF, CR and LF are all read as the same line break, so a file saved on Windows compares cleanly against the same file saved on macOS or Linux. If the two sides use different endings, a notice says so.
What is a unified diff?
A unified diff is the patch format used by the diff command and by tools such as Git. It lists only the changed hunks with a few lines of context, marking removed lines with - and added lines with +. Choose the Unified diff view, or press Copy unified diff, to get that text.
Why does an accented letter show as different when the two texts look the same?
The same visible letter can be stored two ways in Unicode: as one precomposed character, or as a base letter plus a combining accent. Tick Treat equivalent Unicode forms as equal to compare them in normalized form and treat them as a match.
Is my text uploaded anywhere?
No. The comparison runs in your browser and the text you paste is not sent to a server. The page itself still loads the site analytics and advertising scripts, so avoid pasting anything you would not paste into a normal web page.
Why does a notice say the result is approximate?
To keep the page responsive, the exact search stops after 3,000 edits. If two long texts are almost entirely different, the changed middle is shown as one removed block and one added block instead of a line-by-line match. Compare smaller sections, or use line mode, to get a precise result.
How do I ignore whitespace differences when comparing text?
Tick Ignore whitespace. In line mode, spaces and tabs at the ends of lines and repeated spaces inside them are ignored; in word and character mode all whitespace is left out. This is similar to the -b and -w options of git diff.
Sources
- The Open Group Base Specifications: diff (retrieved 2026-10)
- Git documentation: git-diff (unified format, context, whitespace and word-diff options) (retrieved 2026-10)
- Unicode Standard Annex #15: Unicode Normalization Forms (retrieved 2026-10)
- MDN Web Docs: Intl.Segmenter (retrieved 2026-10)