Diff Checker
Paste two versions of some text or code to see exactly what changed, line by line with the changed words highlighted. Side by side or unified, with a downloadable patch. Runs in your browser.
Try an example:
Private by design: both texts are compared on your device. Nothing is uploaded or stored, so it’s safe for contracts, code and config files.
How to use the Diff Checker
- Paste the original text into the left box and the changed version into the right. It works with anything: contracts, essays, code, config files, CSV data or lists.
- Press Compare (or Ctrl+Enter). The summary shows how many separate changes there are, how many lines were added and removed, and the length of each version.
- Read the result. Removed lines are red, added lines are green, and inside a changed line the exact words that differ are highlighted more strongly.
- Switch between Side by side and Unified views, or tick Only show changes to hide everything that matches.
- Use Copy unified diff or Download .patch to share the changes, or Swap to compare the other way round.
If you enjoy what we do, consider supporting us. Every little bit means the world! Support Catpool on Ko-fi
Side by side or unified?
Side by side puts the two versions next to each other with line numbers, and lines up each changed line with its replacement. It’s the easiest view for documents and for spotting small edits in long lines. Unified shows one column, with removed lines (−) followed by the lines that replaced them (+). It’s the format developers know from Git, GitHub pull requests and code review tools, and it works better on a phone screen.
In both views, long stretches of unchanged text are folded into a single “unchanged lines” row, with three lines of context kept either side of each change, so you can jump straight to what matters.
Ignore whitespace and ignore case
Often the changes you care about are hidden among changes you don’t. Tick Ignore whitespace to treat lines as the same if they differ only in spaces, tabs or indentation. This is handy after reformatting code, or when one version uses tabs and the other uses spaces. Tick Ignore case to treat “London” and “LONDON” as the same. Both options affect which lines count as changed and which words are highlighted. The original text is always shown exactly as you pasted it.
How the comparison works
The checker uses the Myers diff algorithm, the same approach used by Git and GNU diff. It finds the smallest set of added and removed lines that turns the original into the changed version, so the result reads the way a person would describe the edit. Changed lines are then compared word by word to highlight exactly what moved. If two lines are almost completely different, the whole line is marked rather than scattering highlights everywhere.
The downloadable patch is a standard unified diff with @@ hunk headers and three lines of context. You can apply it with git apply or patch -p0, or paste it into an issue or chat so others can see exactly what changed. Differences in the final line break are recorded with the usual “No newline at end of file” marker.
Good uses
- Contracts and terms: see exactly what the other side changed in a revised agreement before you sign.
- Writing and editing: compare drafts of an essay, article or CV.
- Code and config: check two versions of a script, YAML file,
.envor nginx config without opening an IDE. - Data: compare two exports, lists of email addresses or CSV files to find missing or extra rows.
- Copied text: check whether a quote or a block of code was changed when it was copied.
Privacy
Many online diff tools upload both texts to a server and give you a shareable link, which isn’t ideal for contracts, client data or private code. This tool runs entirely in your browser. Neither text is uploaded, saved or logged, and closing the page clears everything. The patch file is created on your device too.
Frequently asked questions
Can it compare Word or PDF files?
Not directly. Open each document, select all, copy the text and paste it into the boxes. Formatting such as bold or fonts isn’t compared, only the words.
How large can the texts be?
Tens of thousands of lines compare in well under a second on a modern device. If two very large texts are almost completely different, the checker shows them as fully replaced rather than slowing your browser down.
Why is a moved paragraph shown as removed and added?
Diff algorithms describe changes as additions and removals in order, so moving a block shows up as a removal in one place and an addition in another. This is the same in Git.
Does it detect changes in line endings?
Windows (CRLF) and Unix (LF) line endings are treated as the same, so you see the real content changes only.
Related: Catpool home, Developer, JSON Formatter, Regex Tester, Text Cleaner, Word Counter.
