jarvisbox

YAML Merge Patch Generator

A JSON Merge Patch (RFC 7396) is a compact way to express the difference between two JSON or YAML documents. It contains only the changed or added fields, with removed fields set to null. Merge patches are used by kubectl patch --type=merge, Kustomize strategic merge patches, and many Helm and GitOps workflows.

Instead of writing a merge patch by hand — which requires carefully enumerating every changed field in the nested document structure — this tool generates it automatically. Paste the original YAML into Before and the desired state into After, then click "Copy as kubectl patch" to copy the generated merge patch to your clipboard.

The patch can be applied directly with kubectl patch deployment my-deployment --type=merge --patch '{"spec":{"replicas":4}}' or saved as a Kustomize patchesStrategicMerge file. For multi-document Kubernetes streams, a patch is generated per document keyed by kind+name, so you can apply changes to specific resources without touching others.

Open YAML Semantic Diff →

How to use

  1. Paste your original YAML (Helm values, K8s manifests, or any multi-document stream) into the Before box.
  2. Paste the updated version into the After box. Enable Key docs by kind+name for Kubernetes streams.
  3. Click Compare to see the semantic diff, then use Copy as kubectl patch to export a merge patch.

Related tools

反馈这个工具的问题