Spread the love

2 min read

Compare two YAML snippets online. Review line-by-line changes or compare parsed YAML values while ignoring formatting differences. Your text is processed in your browser.
Comparison result
Compare the two inputs to see changes.
Your comparison will appear here.

Green lines are additions; red lines are removals. Text mode compares exact lines. Semantic mode parses YAML and ignores mapping key order and formatting; sequence order remains significant. Anchors, tags and YAML features are interpreted by the parser version loaded below.

How YAML Diff & Compare works

Paste the original YAML into the left panel and the updated version into the right panel, then select Compare.

Text diff compares lines exactly, including formatting and whitespace. Added lines are highlighted in green and removed lines in red.

Semantic YAML comparison parses both inputs first, then compares their values. Mapping key order and formatting differences are ignored, but sequence order still matters. If either document contains invalid YAML, the tool reports an error instead of presenting a misleading comparison.

The comparison runs in your browser. Semantic mode uses js-yaml; if that library cannot load, use text diff or try again after checking your connection.

Example

Original:

app:
  name: ccodelearner
  port: 3000

Updated:

app:
  name: ccodelearner
  port: 8080

The comparison highlights the old port as removed and the new port as added.

Frequently asked questions

Does the tool upload my YAML?
The comparison code runs in your browser. Semantic mode loads the YAML parser from a CDN; your YAML text is not sent to that library.

What is the difference between text and semantic comparison?
Text mode compares exact lines. Semantic mode parses YAML and ignores mapping key order and formatting.

Does semantic mode ignore array order?
No. Sequence order is meaningful in YAML and remains significant.

What happens if the YAML is invalid?
Semantic mode displays the parser error instead of comparing invalid values. Text mode can still compare the raw text.

Can I download the result?
Yes. Use Download diff.txt to save the displayed comparison report.