Unified Patch
Generate git-style unified diffs, structured patch JSON, or apply a patch to original text — fully offline. · Updated
Options
Mode:
Context lines:
text
Unified patchdiff
Draft saved locally.
Options
| Option | Description |
|---|---|
| Mode | Create a patch from two sides, export structured hunk JSON, or apply a unified patch under === PATCH ===. |
| Context lines | Number of unchanged context lines around each hunk (unified/structured modes). |
FAQ
How do I format input for creating a patch?
Separate original and modified text with === MODIFIED ===, or pass JSON with original and modified fields.
How does apply mode work?
Put the base file above === PATCH === and a unified diff below it. The tool attempts a clean apply locally.
Is this the same as Diff Checker?
Diff Checker focuses on visual comparison. This tool emits and applies standard unified patches.
Does any code leave my machine?
No. Patch creation and application run entirely client-side.
Can I name the file in the patch header?
Yes. Add === FILE: path/to/file === above the original side, or include fileName in JSON input.
Related tools
Diff Checker
Compare two text or code snippets side-by-side to highlight added, removed, and modified lines instantly.
JavaScript Beautifier
Format, un-minify, or compact JavaScript & TypeScript code into clean, readable scripts with custom indentation.
SQL Formatter
Format messy SQL into readable, consistently indented queries.
JSON Formatter
Format, validate, and explore JSON with a collapsible tree view.