TFT

JSON Patch Generator – Generate Patch Operations

Generate RFC 6902 JSON Patch operations to transform one JSON document into another. Our free tool is ideal for versioning APIs and tracking incremental JSON changes.

About JSON Patch Generator

Tracking changes between two JSON documents manually is error-prone. This tool automatically generates RFC 6902 JSON Patch operations that describe exactly how to transform one document into another, perfect for version control and sync operations.

How it works

Provide your original JSON as the source and your desired result as the target. The tool compares both documents and produces a sequence of add, remove, and replace operations needed to convert source into target.

Each operation includes a JSONPath-style path pointing to the exact location of the change. You can review the operations before applying them or use them directly in your application's patch logic.

When you'd use this

You're building a collaborative editor where multiple users modify shared JSON data. Instead of sending entire documents, transmit only the patch operations to reduce bandwidth and enable conflict resolution.

The generated patches follow RFC 6902 but don't support all advanced operations like move or copy. For complex scenarios, you may need a full JSON Patch library with complete RFC compliance.

Questions

What operations does this tool generate?

The tool generates add, remove, and replace operations. These cover most common change scenarios like adding new fields, deleting old ones, and updating values.

Can I apply the patches back?

Yes, click Apply to Source to see the patches transform your original JSON into the target. This verifies the patch operations work correctly.

How are array changes handled?

Array modifications use numeric indices in the path. Adding or removing array items generates operations with specific index positions for precise changes.

What if both JSONs are identical?

The tool will generate an empty patch list since no operations are needed. This is useful for verifying that two documents are truly equivalent.

Can I download the patch operations?

Yes. Use the Download button to save patches as a JSON file, or Copy to paste them into your code. The format is ready to use with JSON Patch libraries.