All Over Tools logo
Tool Combiner
Analyze Tools Clean Tools Compare Tools Convert Tools Data Validation Extract Tools Format Tools Generate Tools Organize Tools Transform Tools
Audio Tools Font Tools Image Tools Subtitle Tools Video Tools
Archive Tools Document Tools Ebook Tools File Management Tools PDF Tools Presentation Tools
Config Tools Database Tools Dataset Tools JSON Tools Parser Tools Spreadsheet Tools XML Tools
Business Calculators Construction Calculators Date And Time Calculators Education Calculators Financial Calculators Food Calculators Health Calculators Math Calculators Science Calculators Sports Calculators Statistics Calculators
Blog About Us Contact Us

YAML Diff

Compare two YAML files by structure. See which values were added, removed or changed, reported by document and path.

Original (A)

Modified (B)

How to compare two YAML files

Paste or upload both files. The comparison runs on its own as soon as each side has text.

  1. Put the first file in Original (A) and the second in Modified (B). The upload icon under each box loads a .yaml, .yml or .txt file.
  2. Turn on Compare comments or Compare anchor names under the boxes if those differences matter to you.
  3. Read the counts, then the Differences table. Each row has the change kind, the node type, the document number and the path.
  4. Use the filters to narrow the table, and Export JSON or Export CSV to save what is currently shown.

What counts as a difference

Both files are parsed first, so the comparison is about the data and not the text. Different indentation, single versus double quotes and a different order of keys in a mapping are all ignored.

# A
env:
  - dev
name: "app"

# B
name: app
env:
  - dev

Those two files report no differences. Lists are different: items are matched by position, so moving an item reports a change at both positions.

Paths read like env[1] or spec.replicas. A file with several documents separated by --- is compared document by document, and the Document column says which one.

Anchors, aliases and merge keys

Aliases and merge keys are resolved before the comparison, so a value pulled in with *default or << is compared as the full value it stands for. Compare anchor names adds a row when the anchor name on a node differs between the files, which the resolved values alone would hide.

Limits

The tool is a self-contained parser, not a full YAML 1.2 implementation. If a file cannot be parsed, an error names the file and the line instead of showing a partial result. Nothing is uploaded; parsing and comparing happen in the page.

Frequently asked questions

Does indentation or quoting count as a difference?

No. Both files are parsed first, so indentation, quote style and the order of mapping keys do not matter. Only the values and the structure are compared.

Is the order of list items ignored?

No. Sequence items are compared by position, so moving an item to a different place is reported as a change.

How are anchors, aliases and merge keys handled?

They are resolved before comparing. A value that comes from an alias is compared as if it had been written out in full. The optional Compare anchors setting also reports when an anchor name itself differs.

Can I compare files with several documents?

Yes. A stream separated by --- is compared document by document, and each difference shows its document number. A document that exists in only one file is reported as added or removed.

Are my files uploaded?

No. Parsing and comparison run in your browser, and the text is not sent anywhere.

Related Tools

1 view