Skip to content

JSON and YAML diff

Paste two documents. The differences are listed by path.

Ctrl+Enter or ⌘+Enter runs this tool immediately.

Original
Changed
Differences

Paste both documents to compare them.

Waiting for input.

Parsing stays in this browser. Input is not uploaded or saved.

How to use this tool

  1. Paste the original on the left and the changed version on the right, or load the sample.
  2. Read the differences. + is added, - is removed, and ~ is a changed value, each with its path.
  3. Copy the list into a review or a ticket.

Supported formats and limitations

  • JSON and YAML can be mixed. Each side is read as JSON first and as YAML if that fails.
  • Values are compared, not text. Key order, quotes, indentation, and comments do not count as changes.
  • Lists whose items all have a unique name, such as containers and env, are matched by name. Other lists are compared by position.
  • One document per side. A YAML stream with --- is rejected.

Examples

The same keys in another order

Compared with {"a": 1, "b": 2}, this YAML has no differences.

b: 2
a: 1

A changed image

The path names the container, not its position: spec.containers[name=app].image.

spec:
  containers:
    - name: app
      image: web:1.5

Common errors and solutions

This input contains 2 YAML documents
Compare one document at a time. Paste each resource separately.
Original: ... or Changed: ...
The label says which side failed to parse. Fix that side and the comparison runs again.

FAQ

Why is a moved container not shown as a change?
Items with a unique name are matched by name, so the order of containers or env entries does not matter. Only their values are compared.
Can I compare JSON with YAML?
Yes. Both are read into values first, so a JSON file and its YAML version show no differences.
Are the documents uploaded?
No. Both are compared in your browser.

Related tools

  • YAML to JSON converter

    Convert YAML configuration to readable or compact JSON in the browser. Comments are dropped, and parse errors include line and column when the parser reports them.

  • JSON formatter

    Validate JSON, then pretty-print it with 2 or 4 spaces or minify it. Invalid JSON produces an error and leaves the output empty.

  • Kubernetes YAML syntax check

    Check the YAML syntax of a Kubernetes manifest, including files with more than one document. This does not check apiVersion, required fields, or unknown kinds.