LocalDevTools

Diff Checker

Paste the original and the changed version to see exactly what was added, removed or modified. Useful for config files, contracts, API responses and code reviews without a repository.

Runs entirely in your browser. Your input is never uploaded or stored on a server.

How to compare two texts

  1. Paste the original version on the left and the new version on the right.
  2. Click Compare. Removed lines are red, added lines are green, and inside a changed line the exact words that differ are highlighted more strongly.
  3. Switch between Side by side, which is easiest for prose and config, and Unified, which matches what git diff shows.
  4. Tick Ignore whitespace to hide changes that are only indentation or trailing spaces, which is common after reformatting code.
  5. Use Copy as unified diff to paste the result into a ticket, chat or patch file.

How the comparison works

The checker uses the Myers diff algorithm, the same approach behind git diff and GNU diff. It finds the smallest set of line insertions and deletions that turns the original into the new text. Lines that were deleted and inserted at the same spot are paired up, and a second, word-level pass highlights what changed inside them.

Example

server:
  port: 8080
  host: localhost
  debug: true
server:
  port: 9090
  host: localhost
  debug: false
  timeout: 30

The result shows two modified lines (the port and the debug flag, with just the values highlighted) and one added line (timeout). In unified view that is:

 server:
-  port: 8080
+  port: 9090
   host: localhost
-  debug: true
+  debug: false
+  timeout: 30

Tips

  • To compare JSON, format both sides first with the JSON formatter using Sort keys. Otherwise a single-line JSON blob shows up as one giant changed line, and key order differences look like changes.
  • Windows (CRLF) and Unix (LF) line endings are normalized before comparing, so a file that only changed line endings is reported as identical.

Frequently asked questions

Is my text uploaded to compare it?

No. The diff is computed in JavaScript on your device. That makes it suitable for confidential documents, credentials files and unreleased code.

What is the difference between side-by-side and unified view?

Side-by-side shows the two versions in parallel columns. Unified shows one column where removed lines start with - and added lines with +, the format used by git and patch files.

Can I compare files instead of pasting?

Open the files in any editor and paste their contents. Because everything runs locally, large files of several thousand lines compare in a moment.

Why does an entire paragraph show as changed?

The comparison is line-based. If a paragraph is one long line, any edit marks the whole line, but the word-level highlight still shows exactly which words changed.

Does "ignore whitespace" change my text?

No. It only affects how lines are matched. The output still shows your original text.

Related tools

Last updated: