Diff → Unified Patch Formatter
Generate git-style unified diffs, structured patch JSON, or apply a patch to original text — fully offline.
Local workspace
Named projects in IndexedDB · Local only — never synced to our servers. Worksp…
Batch workspace
Format multiple files locally in one run.
How to use the Unified Patch
Paste code or file
Paste your raw TEXT text or upload directly.
Configure options
Choose indentation, dialect, or formatting preferences.
Format & export
Click format, then copy, download, or inspect in tree view.
What is a Unified Patch?
Generate git-style unified diffs, structured patch JSON, or apply a patch to original text — fully offline. This tool re-indents and organizes code according to standard style conventions while checking for syntax validity. Everything executes 100% inside your browser, guaranteeing zero latency and complete privacy for API keys, user tokens, and confidential database schemas.
Options Explained
| 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). |
Frequently Asked Questions
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.