Apply Diff
Apply a unified diff (patch) to a text file. Verifies each hunk against the source and fails loudly on a mismatch. The counterpart to Text Diff.
About Apply Diff
Apply Diff takes a unified diff (a patch) and applies it to a text file, verifying every hunk against the source and failing loudly if anything does not line up. It is the counterpart to Text Diff: one produces the patch, this one applies it. Because it runs in your browser, you can patch sensitive files without sending them to any server.
- Category
- dev
- Input
- Accepts: text/plain.
- Output
- Outputs: text/plain (multiple).
- Cost
- Free, runs in your browser
- Memory
- low
Common uses
- Apply a code review patch someone pasted into a chat without setting up git locally
- Reproduce a colleague's edit on your copy of a config file from the diff alone
- Verify that a patch still applies cleanly to a file before committing it upstream
- Apply a small change to a snippet you pasted in, when running the patch tool would be overkill
- Confirm a hunk fails on a mismatch so you catch a stale or wrong patch early
- Walk a documentation fix from a unified diff into the original Markdown source
Frequently asked questions
What patch format does it accept?
Standard unified diff format, the same output produced by Text Diff and most git/diff tools.
What happens if the diff does not match the file?
It fails loudly. Each hunk is checked against the source and a mismatch stops the operation rather than producing a corrupt result.
Does my file get uploaded?
No. Both the source text and the patch are processed entirely in your browser.
Is this a full git apply replacement?
It applies unified diffs to a single text input. It is meant for quick, server-free patching, not for managing a whole repository.
What do I get back?
The patched text as plain text, ready to copy or download.
Keywords
- diff
- patch
- apply
- unified
- hunk
- merge