Diff Checker
Paste two versions of a text, config file or piece of code to see exactly what changed: lines added and removed, and the individual words that differ within a changed line. The comparison runs in your browser, so nothing you paste is uploaded, stored or given a shareable link.
How the Comparison Works
The checker compares the two texts line by line and finds the smallest set of lines to delete from the original and insert from the changed version that turns one into the other. It uses Eugene Myers' O(ND) difference algorithm, the same approach git and GNU diff use by default, so the result matches what you would see in a code review.
Inside each changed line pair it runs the same comparison again on words, spaces and punctuation, and highlights only the pieces that differ. A port number that went from 8080 to 8443 shows as one changed word, not a whole changed line.
A diff describes the shortest edit, not necessarily the edit you made. Moving a paragraph shows as a deletion in one place and an insertion in another, because to a line diff a moved line is a removed line and an added one. If a diff looks more complicated than your change, that is usually why.
Whitespace, Case and Invisible Differences
Ignore whitespace treats lines as equal if they match once leading and trailing spaces are removed and runs of spaces and tabs are collapsed. That is what you want after re-indenting code or reflowing a document, but not for Python, YAML or Makefiles, where indentation is part of the meaning.
Ignore case treats "Error" and "error" as the same line. It helps with SQL keywords, HTML tags and hostnames, and hides real differences almost everywhere else, so it is off by default.
The most confusing diffs are the ones where two lines look identical. The usual causes are line endings β Windows ends lines with CRLF and macOS and Linux with LF β a missing newline at the end of a file, a tab where the other side has spaces, or a non-breaking space pasted from a web page or word processor. The checker tells you when a final newline is the only difference. Line endings are the one thing it cannot see: browsers convert every line ending in a text box to LF as you paste, so a file with Windows CRLF endings and the same file with Unix LF endings compare as identical here. To check line endings, use a command-line tool such as git diff or file.
Reading a Unified Diff
The Copy as unified diff button produces the same format as diff -u and git diff, which you can paste into a ticket, a chat message or a code review, or apply with the patch command. For the example above it looks like this:
--- original
+++ changed
@@ -1,11 +1,11 @@
server:
host: 0.0.0.0
- port: 8080
+ port: 8443
timeout: 30
+ tls: true
logging:
- level: info
+ level: debug
format: json
features:
- search
- - export
- billing
The two header lines name the original and changed versions. Each @@ line starts a hunk: -1,11 means the hunk covers 11 lines starting at line 1 of the original, and +1,11 the same for the changed version. Inside a hunk, lines starting with a minus sign were removed, lines starting with a plus sign were added, and lines starting with a space are unchanged context included to show where the change sits.
Side by Side or Unified
Side by side puts the original on the left and the changed version on the right, with each changed line opposite its replacement. It is easiest to read when most changes are edits to existing lines. The unified view interleaves both versions in one column, which fits narrow screens and makes long runs of added or removed lines easier to follow. It is the view a phone opens with.
Either way, long stretches of unchanged text are folded away and replaced by a row saying how many lines are hidden, keeping three lines of context around each change. Click the row to expand it, or tick Show all unchanged lines to see everything.
Why Compare Locally
People compare contracts, configuration files with credentials in them, customer data exports and unreleased code. Many online diff tools send both texts to their server, and some save the result behind a shareable link that anyone with the address can open.
This checker does the whole comparison in JavaScript in your browser. Nothing is uploaded, nothing is stored, and the texts are never put in the page address. You can confirm that by opening your browser's network panel before you paste.
Related Tools
Two JSON documents with different formatting diff as almost entirely different. Format both the same way first and only the real changes remain. Normalise them with the JSON Formatter.
To check whether two large files are identical without reading them, compare their checksums instead. Compute them with the Hash Generator.
When a diff shows the same kind of change on many lines, a pattern can usually find or make it everywhere at once. Build that pattern in the Regex Tester.
Encoded blobs differ in ways you cannot read. Decode both sides first to see what actually changed. Decode them with the Base64 Encoder.
References
- Eugene W. Myers: An O(ND) Difference Algorithm and Its Variations (Algorithmica, 1986)
- GNU Diffutils manual: Unified Format
- Git documentation: git diff
Frequently Asked Questions
How do I compare two texts for differences?
Paste the original into the left box and the changed version into the right. The differences appear as you type: removed lines in red, added lines in green, and the specific words that changed within a line highlighted more strongly. Switch between side-by-side and unified views, and copy the result as a unified diff if you need to share it.
Is the text I paste uploaded anywhere?
No. The comparison runs entirely in JavaScript in your browser. Nothing is sent to a server, saved, or put in the page address, so the checker is safe to use with confidential documents, configuration files and code.
Why are lines that look identical marked as different?
Something invisible differs: usually trailing spaces, a tab against spaces, or a non-breaking space pasted from a web page or word processor. Tick Ignore whitespace to see whether the difference goes away. If every line matches but the texts still differ, the checker tells you the only difference is a newline at the end. Differences in line endings alone cannot show up here, because browsers convert them all to the same form when you paste.
Why does a line I moved show as deleted and added?
A line diff describes the shortest set of deletions and insertions between the two texts, and it has no separate operation for a move. A moved line is therefore removed from its old position and inserted at its new one. Git, GNU diff and code review tools show moves the same way.
What does @@ -1,4 +1,5 @@ mean in a diff?
It is a hunk header in unified diff format. -1,4 means the hunk covers four lines of the original starting at line 1, and +1,5 means five lines of the changed version starting at line 1. The lines below it start with a minus sign if removed, a plus sign if added, or a space if unchanged.
Can I compare JSON or code with this tool?
Yes β any plain text works, including code, JSON, YAML, CSV and logs. For JSON, format both documents the same way first, or a change in indentation or key layout will make almost every line differ. Leave Ignore whitespace off for Python and YAML, where indentation changes meaning.