# JSON Patch builder

- Human page: https://happytails.ai/en/developer-tools/json-patch-builder/
- Markdown: https://happytails.ai/en/developer-tools/json-patch-builder.md
- Structured JSON: https://happytails.ai/agents/en/developer-tools/json-patch-builder/index.json
- Visibility: public

## Tool capabilities

| Property | Value |
| --- | --- |
| Tool ID | `json-patch-builder` |
| Category | developer-tools |
| Implementation | Registered implementation. Registration alone is not a production-quality guarantee. |
| Browser execution | Use the visible action or interactive controls. |
| Browser processing | Browser; see tool notes for network behavior. |
| HTTP API | Not callable through HTTP. |
| Browser-agent interface | No callable WebMCP interface. |

### Implementation notes

Build and verify an RFC 6902 patch between two JSON documents. The builder emits add, remove and replace operations in deterministic order, replacing changed arrays in full. It does not promise a minimal patch or apply arbitrary move, copy or test operations. No API request is sent.

### Inputs and settings

Text input: Original JSON document.

Example or placeholder shown in the interface (not a validated fixture):

```text
{
  "profile": {"name": "Alex", "city": "Lisbon"},
  "tags": ["old"]
}
```

Paste the original JSON document. Use the second editor for the merge patch or target document. Up to 1,000,000 characters. Review the settings before running.

| Setting | Meaning | Control type | Default | Constraints |
| --- | --- | --- | --- | --- |
| `change` | Target JSON | text | "{\n  \"profile\": {\"name\": \"Alex\", \"city\": \"Porto\"},\n  \"tags\": [\"new\"],\n  \"active\": true\n}" |  |

### Planning specification

Up to 1,000,000 characters, 50,000 values and 64 nesting levels per document. UTF-8 file imports are limited to 1 MB. Processing runs in a local worker with a 10-second timeout and a bounded work budget. Duplicate keys and numbers that cannot be preserved safely are rejected.

This describes intended requirements. Use the implementation notes, interface schema and observed output to determine current support.

### Complete machine-readable capability record

```json
{
  "id": "json-patch-builder",
  "category": "developer-tools",
  "built": true,
  "requirements": "Up to 1,000,000 characters, 50,000 values and 64 nesting levels per document. UTF-8 file imports are limited to 1 MB. Processing runs in a local worker with a 10-second timeout and a bounded work budget. Duplicate keys and numbers that cannot be preserved safely are rejected.",
  "implementation": {
    "fields": [
      {
        "key": "change",
        "label": "Target JSON",
        "value": "{\n  \"profile\": {\"name\": \"Alex\", \"city\": \"Porto\"},\n  \"tags\": [\"new\"],\n  \"active\": true\n}",
        "type": "text"
      }
    ],
    "inputMaxLength": 1000000,
    "inputErrorCode": "PATCH_INPUT",
    "note": "Build and verify an RFC 6902 patch between two JSON documents. The builder emits add, remove and replace operations in deterministic order, replacing changed arrays in full. It does not promise a minimal patch or apply arbitrary move, copy or test operations. No API request is sent.",
    "experience": {
      "automatic": false,
      "single": false,
      "inputMaxLength": 1000000,
      "inputMode": "text",
      "label": "Original JSON document",
      "placeholder": "{\n  \"profile\": {\"name\": \"Alex\", \"city\": \"Lisbon\"},\n  \"tags\": [\"old\"]\n}",
      "help": "Paste the original JSON document. Use the second editor for the merge patch or target document. Up to 1,000,000 characters. Review the settings before running.",
      "action": null
    },
    "mode": "explicit",
    "interactive": true
  },
  "execution": "Browser interface",
  "api": null,
  "browser_agent": {
    "supported": false,
    "name": null,
    "discovery": "WebMCP on the human page in a supporting browser",
    "verification": "See audit/API-AUDIT.md; availability is not verification"
  }
}
```

## Page guide

Create a JSON Patch from an original and target document, then verify that applying it produces the target.

How can we improve this tool?

Report a problem or share an idea.

Please leave out private information. Your message and the tool name go to our team via PostHog.

### How to use JSON Patch builder

1. Paste the original and target JSON documents, or open two UTF-8 JSON files.
2. Build the patch. The tool reapplies its generated operations and checks the result against the target.
3. Copy the patch or download the patch, resulting JSON and complete report.

## Useful next steps

- [JSON Merge Patch tester](https://happytails.ai/en/developer-tools/json-merge-patch-tester/) ([Markdown](https://happytails.ai/en/developer-tools/json-merge-patch-tester.md))

- [JSON diff](https://happytails.ai/en/developer-tools/json-diff/) ([Markdown](https://happytails.ai/en/developer-tools/json-diff.md))

- [JSON formatter](https://happytails.ai/en/developer-tools/json-formatter/) ([Markdown](https://happytails.ai/en/developer-tools/json-formatter.md))

## A deterministic patch, not a minimal patch

The builder uses add, remove and replace operations with escaped JSON Pointer paths. Object keys are handled in sorted order; changed arrays are replaced as a whole. Up to 500 operations are supported.

### Review before sending

The generated patch is verified locally against these documents. It does not contact an API, check authorization or protect against later server changes. It is not an editor or validator for arbitrary move, copy or test operations.
