Diff Checker
Paste an original and a changed version of any text or code to see exactly what was added, removed or changed — line by line, with the changed words highlighted. Switch between side-by-side and inline views.
+1 added · −0 removed · 3 changed lines
See exactly what changed
Two versions of a contract, a config file before and after a deploy, an article draft and its edit, or a code snippet someone sent back — reading them side by side and hunting for differences is slow and error-prone. A diff checker does the comparison for you and highlights every addition, deletion and edit. This one runs entirely in your browser, so it’s safe for private documents and proprietary code.
How to compare two texts
- Paste the original version on the left and the changed version on the right.
- Choose side-by-side view to see both versions aligned, or inline view for a compact, Git-style list.
- Turn on “Ignore whitespace” to skip indentation and spacing changes, or “Ignore case” to treat upper and lower case as equal.
- Read the summary of added, removed and changed lines, then scan the highlighted result.
- Use Swap to reverse the direction of the comparison.
How to read the result
- Green lines were added in the changed version.
- Red lines were removed from the original.
- Changed lines appear red on the left and green on the right, with the exact words that differ highlighted more strongly.
- Line numbers refer to each version, so you can jump to the same place in your editor.
How the comparison works
The checker uses the classic longest common subsequence algorithm — the same idea behind the Unix diff command and Git. It finds the largest set of lines that appear in both texts in the same order; every other line is either an insertion or a deletion. Runs of deleted and inserted lines next to each other are paired as “changed”, and each pair is compared again word by word, so a one-word edit in a long line stands out immediately instead of the whole line being marked as different.
When to ignore whitespace
Code formatters, editors that convert tabs to spaces and copy-pasting between apps all change whitespace without changing meaning. With “Ignore whitespace” on, lines that differ only in spacing are treated as identical, so you see the real edits. Leave it off when whitespace matters — for example in Python, YAML or Markdown, where indentation changes structure.
Common uses
- Reviewing edits to contracts, policies and articles.
- Comparing configuration files between environments.
- Checking what changed in an API response or a data export.
- Spotting plagiarism or unexpected copy changes on a web page.
Comparing PDFs instead? Use Compare PDF, which extracts the text from both files first. Write and preview documentation with the Markdown Editor, and normalize JSON before comparing it with the JSON Formatter.
Frequently asked questions
How does the diff work?
The checker finds the longest common subsequence of lines between the two texts — the lines they share, in order. Everything else is an addition or removal. Changed lines are then compared word by word to highlight the exact edits.
What does 'ignore whitespace' do?
It treats lines as equal if they only differ in spaces, tabs or indentation. That's useful when code has been re-indented or reformatted and you only want to see real changes.
Side by side or inline — which should I use?
Side by side is easiest for comparing two versions of a document. Inline, like a Git diff, is more compact and works better on narrow screens.
Can I compare PDF or Word files?
This tool compares pasted text. To compare two PDF documents, use our Compare PDF tool, which extracts and compares their text.
Is my text uploaded?
No. Both texts are compared in your browser and never leave your device, so it's safe for private documents and source code.