Development

Difference Viewer

Free diff checker to compare code, text, or config files. Visualize changes in split or unified views.

Difference Viewer
Compare text, code, or configuration files side-by-side with syntax highlighting. Visualize changes in split or unified formats.
1// Original code1// Modified code
2function hello() {2function hello() {
3 console.log("Hello, world!");3 console.log("Hello, React!");
4 console.log("Hello, Next.js!");
4}5}

About Difference Viewer

  • Compare text, code, or configuration files side-by-side
  • View differences in split or unified format
  • Use the language selector to label your comparison context
  • Changes are color-coded (green for additions, red for deletions)
  • Useful for code reviews, tracking changes, or comparing configurations

About this tool

Instantly spot changes between different versions of your code, documents, or configurations with our diff viewer. Works with code in any language as well as plain text, and offers both split and unified viewing modes. Ideal for developers reviewing code changes, system administrators comparing config files, or content creators tracking document revisions. Just paste your content and see exactly what changed.

How to use the Difference Viewer

  1. Paste the old version into Original Text and the new version into Modified Text.
  2. Choose Split or Unified to set how the changes are laid out.
  3. Pick a Language so the copied diff uses a matching file extension.
  4. Review the Differences panel, where added lines are green and removed lines are red.
  5. Click Copy Diff to copy the comparison as a unified diff.

Give us your feedback

Help us improve Difference Viewer!

Frequently asked questions

What is a diff?

A diff is a line-by-line comparison of two versions of a text that shows which lines were added, removed or left unchanged. Developers use diffs to review code changes, and the unified diff format is what Git and patch tools read and write.

What is the difference between split and unified view?

Split view puts the original and modified versions side by side, which makes edits in long files easy to follow. Unified view stacks them in one column, with removed lines followed by added lines, the same layout Git shows in a terminal.

Can I copy the diff as a patch?

Yes. Copy Diff copies the comparison in unified diff format with three lines of context around each change, labelled with original and modified file names, so you can paste it into a code review, ticket or chat.

Is my text uploaded to a server?

The diff is calculated in your browser, so comparing two texts sends nothing to a server. One exception: the Copy buttons above Original Text and Modified Text record the copied text in usage analytics, so select and copy sensitive content yourself instead.

Difference Viewer screenshot