Loading comparison...
Loading comparison...
Unified diff format showing changes between two files. Used by version control systems and code review tools.
The diff format, originating from the Unix diff utility created by Douglas McIlroy at Bell Labs in the early 1970s, represents the differences between two text files in a structured, machine-readable way. The unified diff format, introduced later and popularized by GNU diffutils, shows changed lines with + and - prefixes alongside context lines, and has become the standard output of modern version control systems. Git, Mercurial, and Subversion all produce unified diffs, making it the lingua franca of code review and patch distribution. A patch file is simply a diff saved to disk, designed to be applied to source code using the patch utility.
This workflow predates centralized version control and was essential to early open-source development — Linux kernel patches were distributed as diff files via email for years. The format supports multiple file changes in a single patch, includes file path headers, and can represent binary changes. Tools like interdiff compare two patches against each other, while combinediff merges patches. Modern platforms like GitHub, GitLab, and Gerrit render diffs with syntax highlighting and inline commenting, but the underlying format remains the same text-based representation.
The diff algorithm itself (longest common subsequence) has influenced computer science broadly, appearing in bioinformatics for DNA sequence alignment. Despite its age, the unified diff format remains indispensable to software engineering workflows worldwide.
Comparing diff files themselves is essential when reviewing competing patches, verifying that a regenerated patch matches the original, or understanding how two branches diverge in their proposed changes. Patch files that look similar may apply to different file regions or have conflicting hunks.
Teams distributing patches outside version control need to compare them carefully to catch offset errors, context mismatches, and overlapping modifications before applying them to production code.
UtraDiff opens diff and patch files in dedicated diff syntax highlighting, rendering added lines, removed lines, and hunk headers in distinct colors. Side-by-side view lets you compare two patch files against each other to verify backport completeness. The whitespace toggle suppresses context-line whitespace differences between patch versions.
Alt+Arrow navigation jumps between hunks. Language-aware tokenization distinguishes file path headers from content changes, making multi-file patches scannable.
Supported extensions: .diff .patch