DevBolt
Processed in your browser. Your data never leaves your device.
← Back to tools

Git Diff Viewer

Paste unified diff output (from git diff) and view it with syntax highlighting, line numbers, and side-by-side or inline display.

Ctrl+Enter to parse
Samples:

Paste a unified diff above to render it with syntax highlighting and line numbers.

Frequently Asked Questions

How do I read a git diff output?
A git diff shows changes between two versions of files. Each file section starts with a header showing the old and new file paths (a/ and b/ prefixes). The @@ hunk headers indicate line numbers where changes occur in the format @@ -old_start,old_count +new_start,new_count @@. Lines prefixed with - (shown in red) were removed, lines prefixed with + (shown in green) were added, and lines with no prefix are unchanged context. A modified line appears as a removal followed by an addition. The viewer adds syntax highlighting, line numbers, and the option to switch between unified diff (interleaved changes) and side-by-side display for easier comparison of longer changes.
What is the difference between unified and side-by-side diff views?
Unified diff displays old and new versions in a single column with removed lines (prefixed -) and added lines (prefixed +) interleaved among unchanged context lines. It is compact and is the default output of git diff. Side-by-side diff shows the old version in a left panel and the new version in a right panel with matching lines aligned horizontally. Changed lines are highlighted in both panels, making it easier to see exactly what changed on each line. Unified view works better for small changes and terminal output. Side-by-side view is better for reviewing large changes, complex refactors, and when you need to compare the before and after states simultaneously.
How do I paste a git diff into the viewer?
Copy the output of any git diff command from your terminal and paste it directly into the input area. The viewer accepts standard unified diff format produced by git diff, git diff --staged, git show, git log -p, and git format-patch. It also accepts diff output from GitHub pull request .diff URLs and other tools that produce unified diff format. The parser detects file boundaries, hunk headers, and change markers automatically. You can paste diffs containing multiple files and the viewer separates them into individual file sections with collapsible panels. Syntax highlighting is applied based on the file extension detected from the diff headers.

Related Inspect Tools