Developer Tools
Unified Diff Applier
Apply a unified diff or git patch to your text in the browser. Paste the original and the diff, get the patched result with a per-hunk report. No upload.
Result summary
Hunks applied
1 of 1
Hunks failed
0
Newline at end of file
None
Patched output
The original text with every applicable hunk applied.
function greet(name) {
console.log(`Hello, ${name}!`);
console.log(`Welcome aboard.`);
return name;
}
greet("world");Per-hunk report
- Applied
@@ -1,4 +1,5 @@
Hunk 1 applied cleanly at line 1.
Note
Parsing and patching run entirely in your browser. The original text and diff you paste are never uploaded.
How to use
- Paste the original file or text into the Original text box on the left.
- Paste the unified diff or git patch into the Unified diff box on the right. A full git diff or a bare set of @@ hunks both work.
- Read the patched result in the Patched output box and press Copy result to use it.
- Check the per-hunk report to see which hunks applied cleanly, which were relocated, and which failed.
- Press Use result as original to chain another patch, Load sample for a worked example, or Clear all to start over.
About this tool
Unified Diff Applier takes an original piece of text and a unified diff, the patch format produced by git diff, diff -u, GitHub and GitLab patch views, and most code-review tools, and reconstructs the patched result without a terminal or a git checkout. This is the missing other half of a diff workflow: you can already generate a unified diff, but when a diff arrives by email, in a pull request, or pasted from an AI assistant, applying it by hand is slow and error prone, especially when the line numbers have drifted slightly. Paste the original on the left and the diff on the right, and the patched text appears immediately, ready to copy. The parser is forgiving about real-world diffs. It accepts a full git diff including the diff --git, index, and ---/+++ file header lines, or a bare set of @@ hunks with no headers at all. Hunk headers of the form @@ -l,s +l,s @@ are read with optional counts, context lines, removed lines, and added lines are tracked separately, and the No newline at end of file marker is recognized so a trailing newline is preserved or dropped to match the diff. Each hunk is first applied at the exact line it claims, and if the surrounding context does not match there because the file changed above it, the tool searches nearby lines for the first place the before image fits, which is the same fuzzy relocation that the standard patch program performs. Every hunk gets an explicit verdict in the per-hunk report: applied cleanly, applied after relocating a number of lines up or down, already applied and therefore skipped, or failed because the context could not be found. When a hunk fails, the output still contains every change that did apply, so the result is useful rather than all-or-nothing, and you can resolve the remaining hunk by hand. Line endings are normalized to line feeds for matching and on output, which is the safe default for source code. Everything, parsing, matching, and patching, runs locally in your browser, so the text and diff you paste are never uploaded or stored.
Free to use. Works in your browser. No signup, no login.
Related tools
You may also like
Text Diff
Side-by-side line, word, and character diff with a unified patch.
Open tool
DeveloperJSON Diff Checker
Structural compare with paths for added, removed, and changed values.
Open tool
DeveloperCSV Diff
Key-aware CSV compare with added, removed, and changed rows.
Open tool
DeveloperJSON Patch Builder
Generate RFC 6902 patches from two JSON documents and apply patches with per-op results.
Open tool
DeveloperLine Ending Converter
Convert between LF, CRLF, and CR line endings with detection, counts, and download.
Open tool