Compare two texts and see exactly what changed
The Diff Checker compares two versions of any text and shows every difference between them. Paste the original on the left and the new version on the right: lines that were added are green, removed lines are red, and lines that were edited are paired up with the exact words or characters that changed highlighted inside them.
It is useful whenever two versions of something need checking — a contract that came back with “minor edits”, an essay before and after feedback, two config files or a block of code. You can switch between a side-by-side view and a compact unified view, ignore differences in case, spacing or blank lines, and download the result as a standard .diff patch.
Everything runs in your browser. Neither text is uploaded, so you can safely compare private documents, customer data or unreleased code.
How to use the Diff Checker
- Paste the original version into “Original text” and the new version into “Changed text”, or use “Open file” to load a .txt, .csv, .json, .md or code file on either side. You can also drag a file onto a box.
- The comparison runs automatically as you type. Read the summary: lines added, removed, changed and unchanged, plus an overall similarity score.
- Choose “Side by side” or “Unified” view, and whether changes inside lines are highlighted by whole words or single characters.
- Tick “Ignore case”, “Ignore whitespace” or “Ignore blank lines” if those differences do not matter to you.
- Click a “Show unchanged lines” bar to expand hidden context, or untick “Collapse unchanged lines” to see everything.
- Use “Copy unified diff” or “Download .diff” to share the changes, or “Swap sides” to reverse the comparison.
Diff Checker features
A real diff algorithm
Lines are matched with Eugene Myers’ O(ND) algorithm — the same approach used by Git — so you get the smallest set of insertions and deletions, not a naïve line-by-line comparison.
Word and character highlighting
Edited lines are paired, then diffed a second time at word or character level so a changed date, name or number stands out immediately.
Two views that work on phones
Side-by-side columns on wide screens stack into a single readable list on mobile; the unified view shows old and new line numbers in one column.
Ignore options
Skip differences in letter case, runs of spaces and tabs, or empty lines when you only care about real content changes.
Patch export
Copy or download the result in unified diff format with three lines of context, ready for code review, email or version control.
Private by design
Files are read locally with your browser’s File API and both texts stay on your device.
How the diff is calculated
Finding the differences between two texts is the classic longest common subsequence problem: keep as many lines as possible in the same order and mark the rest as removed or added. This tool first trims the lines both texts share at the start and end, then runs the Myers diff algorithm on the middle. Myers explores edit paths in order of how many edits they need, so the first path that reaches the end is guaranteed to be a shortest edit script. Its running time grows with the size of the text multiplied by the number of differences, which keeps typical comparisons instant.
Each block of removed lines followed by added lines is treated as an edit. Lines are paired in order and compared again token by token — words, spaces and punctuation in word mode, or individual characters in character mode — and the differing tokens are wrapped in highlights. If a pair has almost nothing in common, the whole line is highlighted instead of confetti-like fragments.
For safety on very different inputs, the line-level search stops after 2,000 differences and shows the remaining middle section as replaced.
What the ignore options do
| Option | Treated as identical | Typical use |
|---|---|---|
| Ignore case | Total and TOTAL | Headings, SQL keywords, email addresses |
| Ignore whitespace | a = 1 and a = 1 (runs of spaces/tabs and leading or trailing spaces) | Re-indented code, text copied from PDFs |
| Ignore blank lines | Extra or missing empty lines | Documents reformatted with different paragraph spacing |
Reading a unified diff
The downloaded .diff file uses the unified format understood by Git, GitHub, code review tools and the patch command. Each change block starts with a header such as @@ -12,7 +12,8 @@, meaning “starting at line 12 of the original, 7 lines are shown; starting at line 12 of the new version, 8 lines are shown”. Lines beginning with a minus were removed, lines beginning with a plus were added and lines beginning with a space are unchanged context.
- Comparing data exports? Sort both lists first with Sort Lines and drop repeats with Remove Duplicate Lines, so the diff shows real changes rather than reordering.
- Comparing JSON? Format both sides the same way with the JSON Formatter so every key sits on its own line.
- Text pasted from Word or a PDF often has stray double spaces — tick “Ignore whitespace”, or clean it first with Remove Extra Spaces.
Diff Checker FAQ
How do I compare two texts for differences?
Paste the first version into “Original text” and the second into “Changed text”. The diff checker highlights removed lines in red, added lines in green and changed words inside edited lines, and counts every change for you.
Is this diff checker free and private?
Yes. It is free with no sign-up or limits, and both texts are compared inside your browser. Nothing you paste or open is uploaded to a server.
Can I compare two files instead of pasting?
Yes. Use the “Open file” button above either box, or drag a file onto it. Any plain-text format works, including .txt, .csv, .json, .xml, .md, .html and source code files up to 10 MB. Word and PDF files need to be saved or copied as plain text first.
Why does a whole line show as changed when I only added a space?
By default every character counts, including spaces and tabs. Tick “Ignore whitespace” to treat runs of spaces as one and ignore leading and trailing spaces, or switch to character highlighting to see exactly where the extra space is.
What is the difference between side-by-side and unified view?
Side by side shows the original and the new version in two aligned columns, which is easiest for prose. Unified shows a single column where removed lines are followed by their replacements, with both line numbers — the same layout Git uses. On phones the side-by-side view stacks automatically.
Which algorithm does the diff checker use?
Line matching uses Eugene Myers’ 1986 O(ND) difference algorithm, which finds a shortest set of insertions and deletions. Changed line pairs are then compared again at word or character level with the same algorithm.