All tools

Diff Viewer

Text

View and generate unified diffs with colored added/removed line highlighting

Paste an original and a modified block of text and get a proper unified diff back, generated with a real line-based LCS algorithm rather than a naive line-by-line comparison, complete with the standard three lines of surrounding context per hunk. It's useful for comparing two versions of a config file after a deployment, or generating a diff to paste into a bug report or code review comment when you don't have both versions checked into git side by side. The output is a solid approximation of `git diff` formatting, but it's missing file-mode and index headers a real git patch includes, so applying it directly with `git apply` may need small adjustments first. This compares at the line level; it doesn't highlight word-level changes within a line.

diffpatchunifiedcomparegit

How to use Diff Viewer

  • 1.Paste an original and modified version of a file side by side to see exactly which lines were added, removed, or changed.
  • 2.Generate a unified diff format output to paste into a code review comment, commit message, or bug report.
  • 3.Compare two versions of a config file after a deployment to quickly spot an unintended change.

Frequently asked questions

Does this run in the browser or send my code to a server?
All diffing happens locally in your browser — your text never leaves your machine.
Does it do word-level or only line-level diffing?
Line-level highlighting is the primary mode; it shows which whole lines were added or removed rather than highlighting individual changed words within a line.
Can I diff two files instead of pasting text?
You can paste file contents directly, but there's no file upload — copy and paste the contents of each file into the two input boxes.
Is the unified diff format compatible with `git apply`?
The output follows standard unified diff syntax, but since it's generated from raw text rather than an actual git repository, it lacks file mode/index headers, so it may need adjustment before `git apply` will accept it directly.

Availability

This tool currently runs in the browser only — no REST API, SDK, or MCP equivalent yet.