Git Diff Viewer
Inspect side-by-side Git diff additions and deletions cleanly in your browser.
Git Developer Tools
About Git Diff Viewer
The Git Diff Viewer & Code Comparator visualizes unified Git diffs and patch streams with side-by-side split and inline unified views, syntax highlighting, additions/deletions statistics, and line number tracking.
How to Use Git Diff Viewer
Step 1
Paste your raw Git diff output or patch stream into the editor.
Step 2
Toggle between Split (Side-by-Side) and Unified view modes.
Step 3
Inspect line-by-line additions and deletions with syntax highlights.
Step 4
Click "Copy Diff" to share with your team.
Practical Use Cases for Git Diff Viewer
Git Patch & Commit Inspection
Paste raw `git diff` or `git show` terminal outputs to inspect code modifications in a clean GitHub-style visual interface.
Pre-commit Code Review & Sanity Check
Inspect uncommitted staged changes visually before running `git commit`.
Input & Output Examples
Viewing Git Diff for File Modification
diff --git a/index.ts b/index.ts\n--- a/index.ts\n+++ b/index.ts\n@@ -1,3 +1,3 @@\n-const old = 1;\n+const updated = 2;
Visual side-by-side diff with green additions (+1) and red deletions (-1) highlighted
Key Features & Performance
- ✓Supports standard Git diff syntax (`diff --git`, `--- a/`, `+++ b/`, `@@ -1,3 +1,3 @@`).
- ✓Dual view modes: Side-by-Side Split View and Unified Inline View.
- ✓Displays total additions (+), deletions (-), and modified files count.
- ✓100% Client-Side memory execution guarantees code confidentiality.
- ✓1-Click Copy and 1-Click `.diff` file download.
Key Terminology & Definitions
Unified Diff (Hunk Header `@@ ... @@`)
The standard text format displaying modified lines along with surrounding context lines, marked by `+` for additions and `-` for deletions.
Hunk
A contiguous block of modified code lines within a diff file representing a localized edit.
