Web Tools
Diff Patch Generator
Generate unified diff patches from two text inputs. Configurable context lines, custom file names, downloadable .patch files. Shows added/removed/unchanged line statistics. Runs entirely in your browser — your data never leaves your machine.
diff patch unified compare git text
Published May 30, 2026
All interactive tools run entirely in your browser. Your data never leaves your device.
How It Works
Paste original text in the left panel and modified text in the right panel. The tool computes a unified diff using LCS (Longest Common Subsequence) and outputs a standard unified diff patch that can be applied with git apply or patch.
Features
- Unified diff format: standard
---/+++/@@patch output - Configurable context: 0, 1, 2, 3, 5, or 10 context lines around changes
- Custom file names: set the
--- aand+++ bheader file names - Download .patch: download the generated patch as a file
- Copy to clipboard: one-click copy of the patch output
- Statistics: lines in A/B, added/removed/unchanged lines, hunk count
- Color-coded stats: green for additions, red for removals
- 5 examples: simple edit, function change, config update, added file, deleted lines
- Private: runs entirely in the browser — no data transmitted
Use Cases
- Creating patches to share code changes without a full repo
- Reviewing text differences in unified diff format
- Generating patches for
git applyorpatchcommand - Comparing configuration file versions