Diff Patch Generator & Apply Online
ブラウザーでテキストファイルの 2 つの版から unified diff を生成するか、単一ファイルのパッチを適用します。
When to use Diff / Patch Generator
Generate a unified diff for one text file and preview how a matching patch changes the original text.
How to use Diff / Patch Generator
In Generate, enter both versions and a filename, then generate the patch. In Apply, enter the original text and patch and inspect the result or mismatch error.
Worked example
a followed by a newline → b followed by a newline: @@ -1,1 +1,1 @@ followed by -a and +bHow the tool handles input
The tool uses a/ and b/ filename headers and includes up to three context lines on each side of a change. When the final line lacks a newline, the patch records that explicitly. Apply checks each hunk before returning the result.
Limitations
Apply a unified diff for one text file at a time. The hunk line numbers and context must match the supplied original text. Binary patches, renames and multi-file patches are outside this tool’s scope.
Frequently asked questions
Can this patch files on disk?
No. It produces or applies text within the tool; it does not edit repository files.
What are the main limitations?
Apply a unified diff for one text file at a time. The hunk line numbers and context must match the supplied original text. Binary patches, renames and multi-file patches are outside this tool’s scope.