• Free forever
  • No sign-up
  • Private — runs in your browser

Diff Checker

Paste two versions of a text, code or file and see exactly what changed — highlighted line by line and word by word. Runs entirely in your browser.

How to use the diff checker

  1. Paste the original text on the left and the changed version on the right — or click Open file to load a file.
  2. Click Find difference (shortcut: Ctrl+Enter or ⌘+Enter).
  3. Read the result: red lines were removed, green lines were added, and the exact words that changed are highlighted more strongly.
  4. Switch between Side by side, Unified and Word diff views, and click any “unchanged lines” bar to expand it.

What people use a diff checker for

UseTip
Reviewing code changesUse the unified view and copy the result as a patch to share in a ticket or chat.
Comparing contract or policy versionsUse Word diff to read the new version with every edit marked inline.
Checking config filesTurn on Ignore whitespace so indentation changes don't hide real differences.
Finding what changed in an article or essayPaste each paragraph on its own line for the clearest line-by-line result.
Comparing two listsSort both lists first (one item per line), then compare to see what's missing from each.
Debugging API responsesFormat both JSON responses with our JSON formatter first, then compare.

How diff algorithms work

A diff tool answers one question: what's the shortest list of insertions and deletions that turns text A into text B? This is the longest common subsequence problem — find the longest sequence of lines that appear in both texts in the same order; everything else is a change.

This tool uses the Myers algorithm (Eugene Myers, 1986), the default in Git. It explores possible edit paths in order of how many edits they need, so it finds a minimal diff quickly when the two texts are similar — which is almost always the case. A linear-space refinement keeps memory low even for files with tens of thousands of lines.

After lines are matched, each changed line is compared with its counterpart word by word, so a one-word edit in a long line is easy to spot.

Reading a unified diff

The unified format is what Git, GitHub and most code review tools show:

--- original
+++ changed
@@ -1,3 +1,3 @@
 The quick brown fox
-jumps over the lazy dog.
+jumps over the sleepy dog.
 The end.
  • --- and +++ name the old and new files.
  • @@ -1,3 +1,3 @@ means “3 lines starting at line 1 in the old file, 3 lines starting at line 1 in the new file”.
  • Lines starting with a space are unchanged context, - lines were removed and + lines were added.

You can apply a downloaded .diff file to the original with patch original.txt changes.diff, or with git apply in a repository.

Tips for cleaner comparisons

  • Normalize first. Differences in line endings (Windows vs. Mac/Linux) are ignored automatically; for code, format both versions the same way before comparing.
  • One sentence per line gives far more readable diffs for prose than long paragraphs.
  • Ignore case is handy for comparing lists of names or emails where capitalization doesn't matter.
  • Large files are fine. Everything runs locally, so comparing files with thousands of lines takes a fraction of a second.

Frequently asked questions

How do I compare two texts?

Paste the original into the left box and the new version into the right box, then click Find difference (or press Ctrl+Enter / ⌘+Enter). Removed lines are shown in red, added lines in green, and the exact words that changed inside a line are highlighted.

Is my text uploaded anywhere?

No. The comparison runs entirely in your browser with JavaScript — nothing is sent to a server, so it's safe for private code, contracts and documents.

What's the difference between side-by-side, unified and word diff?

Side by side shows the two versions in parallel columns. Unified shows one column with removed lines (−) above added lines (+), like git diff. Word diff shows the whole text as flowing prose with deletions struck through and insertions highlighted — best for articles and documents.

What does “ignore whitespace” do?

It treats lines as equal when they differ only in spaces, tabs or indentation — useful when code has been re-indented or a file switched between tabs and spaces.

Can I compare files?

Yes — click Open file above either box to load a text file from your computer (code, CSV, JSON, Markdown, logs and so on, up to 10 MB). For Word or PDF documents, copy and paste the text.

What is a unified diff?

A standard text format for describing changes, used by Git, code reviews and the patch command. Lines starting with − were removed, lines starting with + were added, and @@ headers say where each change is. Click Copy as unified diff to get one.

How does the comparison work?

It uses the Myers diff algorithm — the same approach used by Git — which finds the smallest set of line insertions and deletions that turns one text into the other, then compares changed lines word by word.