DevToolsmith

Diff Checker

Paste two versions of a text, config file or code to see exactly what changed. Lines are compared side by side or as a unified diff, changed words are highlighted, with compact context and paged rows for larger comparisons. Download a complete .diff patch regardless of the displayed page.

Runs 100% in your browser — nothing is uploaded

Original text
Tip: drop a file here137 chars · 137 bytes · 9 lines
Changed text
Tip: drop a file here208 chars · 208 bytes · 11 lines

Features

  • Side-by-side and unified views with line numbers for both versions.
  • Word-level highlighting inside changed lines, so a one-character change is easy to spot.
  • Ignore whitespace or case to hide re-indentation and capitalization changes.
  • Patch export: copy or download a standard unified diff you can apply with git apply.

Large files and line endings

Compare up to 2 million characters and 50,000 lines per input. The worker can be cancelled, distant unchanged lines can be hidden, and results render in pages of 200 rows. These display controls never truncate the downloaded patch. CRLF/LF and final-newline changes remain visible in the patch.

The unified diff format

The patch you copy or download looks like this:

--- a/nginx.conf
+++ b/nginx.conf
@@ -1,3 +1,3 @@
-listen 80;
+listen 443 ssl;
 server_name example.com;
 root /var/www;
\ No newline at end of file

@@ -1,3 +1,3 @@ means the hunk starts at line 1 and covers 3 lines in both files. Lines starting with - exist only in the original, + only in the new version.

Compare files on the command line

# Unified diff with 3 lines of context
diff -u old.txt new.txt

# Ignore whitespace changes
diff -uw old.txt new.txt

# Any two files with git's coloring and word diff, even outside a repo
git diff --no-index --word-diff old.txt new.txt

# Apply a downloaded patch
git apply changes.diff     # or: patch -p0 < changes.diff

Comparing JSON? JSON Diff ignores key order and formatting and lists every changed path.

Frequently asked questions

How do I compare two texts?

Paste the original on the left and the new version on the right. Differences are calculated in a background worker and appear below: removed lines in red, added lines in green, and the exact words that changed within a line highlighted. Switch to Unified for a git-style view.

Is my text uploaded anywhere?

No. The comparison runs in your browser, so it is safe for config files, contracts or code that must not leave your machine. Share links keep the text in the URL fragment, which is never sent to a server.

What does “Ignore whitespace” do?

It treats any run of spaces and tabs as a single space and ignores leading and trailing whitespace, so re-indented lines or trailing spaces are not reported as changes. It is similar to diff -w and git diff -w.

What is a unified diff?

The standard patch format produced by diff -u and git diff. Lines starting with - were removed, + were added, and a space means unchanged context. Each @@ -a,b +c,d @@ header gives the starting line and line count in the old and new file. You can apply it with patch or git apply.

Which algorithm does the diff use?

The Myers diff algorithm, the same one git uses by default. A bounded trace budget keeps memory use controlled; very different large inputs may use a valid coarser replacement instead of the smallest edit script. A word-level pass highlights changed tokens. Computation runs in a cancellable worker.