Omnikit
DevFilesMoneyAll tools
Ctrl K
Dev toolsFile toolsMoney calculatorsAll tools
HomeDeveloper toolsJSON Patch Generator and Tester

JSON Patch Generator and Tester

dev

Create an RFC 6902 JSON Patch from two documents, or apply one and see the result

Runs in your browser. Nothing you type is sent anywhere. Checked against sources on 17 Oct 2026.

A JSON Patch is a list of operations that turns one JSON document into another. Paste two documents and this tool writes the RFC 6902 patch, or paste a patch and see the result. It handles all 6 operations, RFC 7386 merge patches too, and passes the shared json-patch-tests suite.

Next:
  • JSON Diff Compare two JSON documents and list every added, removed and changed value
  • JSON Formatter & Validator Format, validate, minify and sort JSON with exact error positions

How to create a JSON Patch from two JSON documents

1

Paste the original document into Original, or press Try an example.

2

Paste the changed document into Changed; the patch appears as you type.

3

Switch to Apply patch to run a patch on the original and check the result.

4

Press Copy to take the patch or the patched document.

About JSON Patch Generator and Tester

REST APIs use PATCH requests to change part of a resource without resending all of it. The body is usually one of two standard formats, and getting either one exactly right by hand is fiddly. This page writes them for you and tests them before they reach a server.

Four modes.

Mode You paste You get
Create patch Original and changed document An RFC 6902 JSON Patch
Apply patch Original and a JSON Patch The patched document, or the failing operation
Create merge patch Original and changed document An RFC 7386 merge patch
Apply merge patch Original and a merge patch The merged document

How patches are created. Objects are compared key by key; arrays are matched on their longest common run of equal items, so removing one item from the middle of a list is one remove operation, not a replace of everything after it. A removal next to an insertion becomes a replace, and nested changes get their own paths. Keys containing a slash or tilde are escaped as ~1 and ~0, as RFC 6901 requires.

How patches are applied. Operations run in order on a copy; if any fails, nothing is applied and the error gives the operation number, its path and the reason. The test operation compares by value, so key order does not matter, while a leading zero in an index such as 01 is rejected, as the specification says.

Merge patch limits. Because null means delete in a merge patch, a changed document holding null cannot be expressed; the page lists those keys and suggests a JSON Patch instead.

How it was checked. Every record of the json-patch-tests suite that the suite enables, the 15 cases of RFC 7386 Appendix A and the RFC 6901 pointer examples pass, and 400 random edits round-trip exactly. Nothing you paste leaves your browser. To compare two documents as readable text instead, use JSON Diff.

Frequently asked questions

What is the difference between JSON Patch and JSON Merge Patch?

JSON Patch (RFC 6902) is a list of operations such as add, remove and replace, each with a path, so it can change array items and set values to null. JSON Merge Patch (RFC 7386) is a partial document: keys to change, null for keys to delete. Merge patches are simpler; JSON Patch is more precise.

How do I generate a JSON Patch from two JSON files?

Paste the original document on the left and the changed one on the right with Create patch selected. The page compares them key by key, matches array items by their longest common run, and writes the add, remove and replace operations. Applying the result to the original gives the changed document exactly.

Why does my JSON Patch fail with a path error?

Each path must already exist, except the last part of an add. A missing parent key, an array index past the end, an index with a leading zero such as 01, or a key containing a slash not written as ~1 makes the whole patch fail. The message names the operation number and the path.

How do I write a key with a slash or tilde in a JSON Pointer?

Write ~1 for a slash and ~0 for a tilde, as RFC 6901 defines. The key a/b becomes the path /a~1b, and m~n becomes /m~0n. The generator escapes keys this way automatically, so a created patch always uses valid pointers.

What does the - index mean in a JSON Patch path?

A path ending in - refers to the position after the last array item, so an add operation with the path /tags/- appends its value to the tags array. Only add, and move or copy as a target, accept -; the other operations need a real index from 0 upward.

Is the JSON I paste sent to a server?

No. Comparing documents, creating the patch and applying it all happen in your browser, and nothing is uploaded or stored. The implementation passes the shared json-patch-tests suite and the 15 merge patch cases from RFC 7386 Appendix A.

Sources

  • RFC 6902, JavaScript Object Notation (JSON) PatchThe six operations, array indexes and "-", and that a failed operation fails the whole patch
  • RFC 7386, JSON Merge PatchThe merge algorithm (null deletes) and the 15 test cases of Appendix A
  • RFC 6901, JavaScript Object Notation (JSON) PointerThe path syntax, with ~0 for ~ and ~1 for /
  • json-patch-testsThe shared test suite for JSON Patch implementations, commit 2a928f90, used as the reference

Last verified 17 October 2026.

Rates and rules change; check the source before you rely on a figure.

Still stuck? Ask about JSON Patch Generator and Tester and anybody who knows can answer. No account needed.

Common uses

  • Apply JSON Patch OnlineRun an RFC 6902 patch on a JSON document and see which operation fails, if any
  • JSON Merge Patch GeneratorCreate or apply an RFC 7386 JSON Merge Patch, the format of HTTP PATCH bodies

Same job, other tools: TSV to JSON – Convert tab-separated values, such as a paste from Excel, into JSON · JSON to YAML – Turn JSON into clean, readable YAML for configs · Query String Parser – Split a URL query string into a table of decoded parameters.

Related tools

All developer tools
Base64 Encode & DecodeText and files to Base64 and back, with URL-safe mode and image previewUnix Timestamp ConverterUnix timestamps to dates and dates to timestamps, in any time zoneJSON to TypeScriptGenerate TypeScript interfaces or types from a JSON sampleCSV to JSONConvert CSV to JSON and JSON to CSV, with a table previewYAML to JSONConvert YAML to JSON and JSON to YAML, with anchors resolvedURL Encoder / DecoderPercent-encode or decode text and URLs, and see every part of a linkColor ConverterHEX, RGB, HSL, HWB, OKLCH and CMYK in both directions, with a contrast checkNumber Base ConverterBinary, octal, decimal, hex and any base to 36, exact at any size, with two's complement
Was this tool helpful?
Omnikit

Small jobs, done in your browser. Free, fast and private. Files are never uploaded.

Files

  • Compress Image
  • Image to PDF
  • Merge PDF
  • Compress PDF
  • PDF to Word
  • Word to PDF

Dev

  • JSON Formatter & Validator
  • Base64 Encode & Decode
  • JWT Decoder, Verifier & Encoder
  • Password Generator
  • UUID Generator
  • Unix Timestamp Converter

Money

  • SIP Calculator
  • EMI Calculator
  • GST Calculator
  • FD Calculator
  • PPF Calculator
  • Lumpsum Calculator
GuidesQuestionsAboutHow we checkLaw library (beta)PrivacyTermsDisclosureContactMore: Exam practice (UGC NET Paper 1)Runs in your browser. Nothing is uploaded. © 2026 Omnikit (theomnikit.com)