YAMLTools logo

YAML Diff: compare two YAML files

Paste the original and the modified YAML. YAMLTools compares the data, not the text: reordering keys, changing quotes or editing comments is not a change. What did change is listed by path — services.db.image: postgres:15 → postgres:16 — and, for Docker Compose and Kubernetes, summarized in their own terms. Everything runs in your browser.

Example:

Original

YAML
Loading editor…

Modified

YAML
Loading editor…

Paste a YAML file on each side to see what changed.

Advertise here · Reach thousands of developers

How the YAML diff works

Data, not lines

Both files are parsed and compared as data. A key that moved, a comment you edited or a value that went from 'single' to "double" quotes is the same data, so it does not show up as a change.

Changes by path

Each change comes with its exact path — spec.template.spec.containers[name=api].image — and its old and new value. Lists of named items (containers, env vars, ports with a name) are matched by name, so reordering them is not a change either.

Summarized for your stack

When both files are Docker Compose or Kubernetes, the diff is summarized in their terms: a new service, an image bump, replicas 2 → 3, a container added to a Deployment, a Service that became a LoadBalancer.

What counts as a change

Counts: added, removed or changed values; list items added or removed; a list whose order changed; a value whose type changed (8080 vs "8080").

Ignored: key order, comments, blank lines, indentation width, quoting style, flow vs block style ([1, 2] vs a list with dashes) and anchors once expanded.

When to use it

Review a Docker Compose upgrade

Paste the old and new docker-compose.yml to see which services changed image, ports or environment before you run docker compose up.

Check a Kubernetes release

Compare the manifests of two releases, even if kubectl or Helm reordered the documents: resources are matched by kind and name.

Find config drift

Compare staging and production config files and get a clean list of what is different, ready to paste into a pull request as Markdown.

Frequently asked questions

What is the difference between this and a normal text diff?

A text diff compares lines, so reordering keys or reformatting a file shows dozens of false changes. This YAML diff compares the parsed data: only real changes appear, each with its path and its old and new value. The side by side view is still there when you want to see the text.

Does it ignore key order and comments?

Yes. In YAML the order of keys in a map has no meaning and comments are not data, so neither counts as a change. The order of list items does matter, so a reordered list is reported as reordered.

Can it compare multi-document Kubernetes manifests?

Yes. Documents separated by --- are matched by kind and metadata.name (and namespace), so a Deployment is compared with the same Deployment even if the files list resources in a different order. Other multi-document files are matched by position.

Can I compare YAML with JSON?

Yes. JSON is valid YAML 1.2, so you can paste a JSON file on one side and a YAML file on the other and only the data differences are shown.

Is my YAML uploaded anywhere?

No. The comparison runs entirely in your browser. The share link carries both files compressed inside the URL fragment (#), which browsers never send to the server.