
JSON Patch Generator
Generate JSON Patch (RFC 6902) online. Diff two JSON docs or build operations manually, preview results, and export. Supports add, remove, replace, move, copy.
About JSON Patch Generator Tool
JSON Patch Generator – precise diffs and updates with RFC 6902
Experience
When you work with modern APIs, syncing documents, or version-controlling configurations, you often need more control than a JSON Merge Patch offers. Instead of replacing entire arrays or setting a key to null, you may want to surgically add, remove, replace, move, copy, or test specific values. That’s where JSON Patch (RFC 6902) comes in. A JSON Patch is an array of operations, each clearly describing a modification at a JSON Pointer path. The JSON Patch Generator at FreeAiToolsOnline.com helps developers, QA engineers, and DevOps teams generate, preview, and apply patches quickly — without manual trial and error.
Expertise
Our tool understands JSON Patch deeply, and covers the full range of RFC 6902 operations:
- Replace — overwrite the value at a path.
- Add — insert a new key or array element.
- Remove — delete a field or array index.
- Move — relocate a value from one path to another.
- Copy — duplicate a value at a new path.
- Test — assert that a value matches before applying.
You can create patches in two ways:
- Diff mode — paste “Original” and “Modified” JSON, and the tool automatically produces a patch that transforms one into the other, including item-level array diffs.
- Builder mode — interactively add operations (choose op, path, value) to build a patch step by step.
Beyond creation, the tool lets you Apply Patch to any base JSON and preview the exact result. That way, you never risk deploying a patch that behaves differently from what you expect.
Authoritativeness
This generator adheres to the official RFC 6902 specification and JSON Pointer syntax (RFC 6901). Arrays are handled by index, with - supported for appending to the end. Each operation is validated before being added, and errors are surfaced clearly (e.g., “Path /users/2/name does not exist”). The interface also compares JSON Patch against JSON Merge Patch in side notes, so users understand when to use each. Developers get not only a working patch but also a reference-quality explanation of why it works this way.
Trustworthiness
All processing happens entirely in your browser. Nothing is uploaded, logged, or shared. Error messages use plain language and point to the specific operation or path causing trouble. Risky cases (like removing from an out-of-range array index) are flagged before you can export. The tool is designed with repeat visitors in mind: autosave remembers your last patch and options, colorful alerts highlight warnings, and every action has an undo/clear option. It’s safe, transparent, and optimized for real-world productivity.
Key Benefits
- Generate JSON Patch arrays automatically or manually.
- Supports all RFC 6902 operations: add, remove, replace, move, copy, test.
- Array-aware diffing to minimize noisy patches.
- Apply and preview patches against any JSON base.
- Export with one-click copy, print, download, or share.
- Autosave and sample data included.
- Inline notes clarify array behavior, pointer syntax, and safe usage.
How to Use
- Paste your Original and Modified JSON, then click Create Patch to auto-generate.
- Or switch to Builder Mode: pick an operation, specify path, and optional value.
- Apply patch to preview the exact result.
- Beautify or minify output before exporting.
- Export patch or result to use in your APIs or CI pipelines.
Practical Use Cases
- API updates: Send minimal payloads when updating users, orders, or configs.
- Document editing: Precisely modify only the parts changed.
- Testing: Generate repeatable patches for regression tests.
- DevOps/CI: Automate infrastructure or app configs with small, auditable patches.
FAQs
What is the difference between JSON Patch and Merge Patch
JSON Patch (RFC 6902) is operation-based (add/remove/replace with paths), while Merge Patch (RFC 7396) is value-based (replace whole objects/arrays, delete with null).
Can I append to arrays
Yes, use - at the end of the path (e.g., /users/-) to add an element.
What if a test operation fails
Then the patch application is aborted, as per RFC 6902.
Is my data uploaded anywhere
No, everything runs locally in your browser.
Related Tools

Temperature Converter
Effortlessly convert temperatures between Celsius, Fahrenheit, Kelvin, and Rankine. Quick, accurate, and free temperature converter tool.

Torque Converter Tool
Shop torque converter tools for easy installation, removal, and diagnosis. Find the right tools for your transmission job. Fast shipping!

Byte Converter Tool
Online Byte Converter: Easily convert bytes to kilobytes, megabytes, gigabytes, and more. Fast, accurate, and free!

Weight Converter Tool
Free & accurate weight converter. Instantly convert between pounds, kilograms, ounces, grams, and other units. Easy-to-use online tool.

Area Converter Tool
Free online area converter. Easily convert square feet, meters, acres, hectares, and more. Accurate and instant area conversions!

Voltage Converter
Quickly convert voltage values with our free online Voltage Converter Tool. Easy and accurate voltage conversion for your electrical projects.