Code Tools

YAML Diff

All tools

Compare two YAML files by their parsed values instead of their formatting.

How it works

Four simple steps

1

Fill both panels

Paste the old YAML into A and the new YAML into B.

2

Press Run

The diff runs on demand, not as you type.

3

Parsed to JSON

Formatting and comments drop away; only the data is compared.

4

Read the markers

Lines marked - exist only in A, lines marked + only in B.

YAML Diff

About YAML Diff

Someone reformatted a values file and changed one setting in the same commit, and the git diff is a wall of red and green. Comparing the parsed data cuts through the formatting noise.

Paste the original into YAML A and the changed version into YAML B, then press Run. Both are parsed with js-yaml and converted to indented JSON, which normalizes quoting, comments, flow versus block style and indentation. The two JSON texts are compared line by line: unchanged lines start with two spaces, lines only in A start with a minus sign, and lines only in B with a plus sign. Copy or download the result as plain text.

The comparison is positional and keeps the original key order, so it works best when both files list keys in the same order. If one side has an extra key near the top, every following line shows up as changed. When order differs, turn both files into JSON and paste them into the path-based JSON comparison, which ignores key order. Kubernetes users comparing manifests can also try the K8s Resource Diff.

Both documents are parsed locally once js-yaml has loaded from its CDN, and neither file is uploaded.

Keyboard shortcut

Ctrl Enter - Run tool
FAQ

Frequently asked questions

See all FAQs

Answers for this tool. For site-wide help, open the FAQ hub.

Yes. Both sides are parsed before comparing, so comments, quote style, indentation width and flow versus block syntax make no difference. Only the data counts.

The tool compares line N of A with line N of B. An added or removed key shifts all later lines, so they appear as both removed and added. Align the key order, or compare the JSON forms with a path-based diff.

An empty document has no value to convert, so the comparison cannot start. Put at least one key in each panel, even a placeholder like empty: true.

View more FAQs

Related tools

View all

HTML Formatter

Beautify and indent HTML markup.

Open

CSS Formatter

Format and pretty-print CSS.

Open

JS Formatter

Beautify JavaScript code.

Open

JSON Formatter

Beautify and validate JSON.

Open

Explore 321 free tools

Everything you need as a developer, marketer or creator - in one beautiful place.

Browse all tools