Code BeautifierDev Tools

Diff → Unified Patch Formatter

Generate git-style unified diffs, structured patch JSON, or apply a patch to original text — fully offline.

Runs 100% in your browser · Zero server logs
Your draft is saved locally in this browser. No editor content leaves this device unless you explicitly share it.

Local workspace

Named projects in IndexedDB · Local only — never synced to our servers. Worksp

Open manager

Batch workspace

Format multiple files locally in one run.

Mode:
Context lines:
text
Unified patchdiff

How to use the Unified Patch

1

Paste code or file

Paste your raw TEXT text or upload directly.

2

Configure options

Choose indentation, dialect, or formatting preferences.

3

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

OptionDescription
ModeCreate a patch from two sides, export structured hunk JSON, or apply a unified patch under === PATCH ===.
Context linesNumber 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.