Diff to patch

0 uploads — runs entirely in your browser, works offline

Git patch

Diff to patch — wrap a unified diff as a git patch

Paste a unified diff and get a git-style patch with the right headers, ready to apply with git apply. It converts entirely in your browser (0 uploads, works offline).

How to use it

  1. Paste your unified diff (the part with @@ hunk headers).
  2. Set the file path the change applies to.
  3. Copy or Download the .patch file.

FAQ

How do I turn a diff into a git patch for free?

Paste the diff and set the file path. This page adds the diff --git and ---/+++ headers around your hunks so the result applies cleanly with git apply, on your device with no upload.

What if my diff already has git headers?

It is passed through unchanged, so you can safely run any diff through the tool without doubling the headers.

Is my diff uploaded anywhere?

No. The conversion runs entirely in your browser and nothing is transmitted or stored, which you can verify by turning off your Wi-Fi.

How do I apply the resulting patch?

Save it as a .patch file and run git apply change.patch from the repository root.

Limits

Wraps a single-file unified diff; multi-file patches should be assembled from one run per file.

Related

The text diff compares two versions; the JSON diff compares documents structurally.

Bookmark this page (Ctrl+D, or ⌘D on Mac) or install the app — it works offline the next time you need it.