Diff checker: find every difference between two texts
Spotting changes between two versions of a document by eye is slow and unreliable, especially when only a comma or a number changed. This diff checker compares the two texts with the Myers difference algorithm, the same approach as git diff, and highlights the lines that were added, removed or modified. Inside changed lines, the exact characters that differ are marked too.
Example
Original Changed
Shipping: 3-5 business days Shipping: 2-4 business days
Returns: 14 days Returns: 30 days
Support: email only Support: email and live chat
Warranty: 2 yearsThe result shows three changed lines, with "3-5" → "2-4", "14" → "30" and "only" → "and live chat" highlighted, plus one added line. Because the lines are next to each other they form a single changed block, and the summary in the toolbar reads 1 change +4 −3: one block, four lines on the changed side and three on the original side.
Views
- Side by side – the original and changed text in two aligned columns with line numbers. Best for reading and reviewing.
- Unified – one column in which every removed line is shown in red directly above the text that replaced it. You can keep editing the changed text in this view. On screens narrower than 640 pixels the page starts in it.
Both views mark the changed characters inside a line, so a single edited word stands out even in contracts, articles and other writing where lines are long.
Options explained
- Collapse unchanged – folds long unchanged stretches and keeps three lines around each change; click a folded bar to open it again. Useful for long files with few changes.
- Ignore whitespace – ignores spaces and tabs at the start and end of a line and treats runs of them inside a line as a single space, so re-indented code and invisible trailing spaces, a common source of "phantom" differences, do not show up as changed.
- Ignore case –
Helloandhellocount as the same.
Prev and Next (or Alt+↑ and Alt+↓) jump from one change to the next, Swap exchanges the two sides, and Copy above each side copies that text.
Windows (CRLF) and Unix (LF) line endings are normalized automatically, so a file edited on a different operating system does not appear completely changed.
When you need a unified diff file
The comparison on this page is visual: it does not write a patch file. If you need one, save the two versions as files and run diff -u original.txt changed.txt > changes.patch in a terminal. For the example above it prints a standard unified diff (the timestamps after the file names are left out here):
--- original.txt
+++ changed.txt
@@ -1,3 +1,4 @@
-Shipping: 3-5 business days
-Returns: 14 days
-Support: email only
+Shipping: 2-4 business days
+Returns: 30 days
+Support: email and live chat
+Warranty: 2 yearsYou can attach that .patch file to a ticket or apply it with git apply or patch.
What people compare
- Two drafts of an essay, contract or policy to see what an editor changed.
- Configuration files from two servers when one behaves differently.
- Code snippets before and after a fix, when a full Git setup is not at hand.
- Log output from a working and a failing run.
- Translations or product descriptions exported at different times.
Comparing structured data
Line-based comparison treats JSON and XML as plain text, so a reordered key or re-indented file looks like a big change. For those formats, use the JSON diff or XML diff, which compare the structure instead. To compare files straight from your disk, the file diff tool is set up for that.
Privacy
Both texts are compared inside your browser. Nothing is uploaded, so you can safely compare contracts, source code or internal documents.