YAML Getting Started
Compare YAML from Base and Contrast through original-source results, Git Diff, URL loading, troubleshooting, and sharing privacy.
Compare YAML parses two YAML documents into data values and compares those values recursively. This guide uses a service configuration to show how Base and Contrast, comparison options, source-line results, Git Diff, and sharing fit together.
Start with Base and Contrast
The editors have a direction:
| Editor | Put here | Typical examples |
|---|---|---|
| Base | The original or reference configuration | The deployed manifest, current Helm values, configuration before a migration |
| Contrast | The configuration you want to review | The proposed manifest, new Helm values, configuration after a migration |
A key or sequence item found only in Contrast is Added. One found only in Base is Deleted. Swapping the inputs exchanges those categories and reverses the before-and-after values of a change.
A complete configuration example
Suppose you are reviewing changes to a billing service. Paste this document into Base:
# Currently deployed configuration
service:
name: billing
enabled: true
port: 8080
replicas: 2
owner: OPS
regions:
- us-east
- eu-west
Paste the proposed configuration into Contrast:
# Proposed configuration
service:
name: billing
enabled: true
port: "8080"
replicas: 3
owner: ops
regions:
- us-east
- eu-west
- ap-south
With the default options, port changes from a number to a string, replicas and owner change values, and ap-south is added. The changed comment does not create a Data Compare difference. Enabling Numeric String Equals Number makes the two port values equivalent; enabling Ignore Value Case makes OPS and ops equivalent.
Enter the YAML
Open Compare YAML and use either editor to:
- paste a YAML document;
- drag and drop a YAML file, or use the file-loading action;
- import YAML from an HTTP/HTTPS URL. A GitHub Gist page URL is resolved to its raw file content.
For URL imports, the source must be accessible to your browser, return YAML or plain text, and allow the browser request through CORS. A successful download can still contain invalid YAML.
Parsing and comparison run locally in your browser. Importing from a URL contacts the source you specify; read the privacy note below before using Share or placing data in a URL.
Choose comparison rules
Use Settings next to Compare to select rules that match your data:
- By Index, LCS, or Unordered controls how YAML sequences are matched.
- Ignore Key Case treats mapping keys such as
Serviceandserviceas equivalent. - Ignore Value Case compares string values without case sensitivity.
- Numeric String Equals Number allows a quoted numeric string such as
"8080"to match the number8080.
Comments and presentation do not add data values. Mapping key order, indentation used for presentation, quote style, and flow-versus-block notation do not create a difference when they produce the same parsed values. See YAML Comparison Rules for sequence examples, duplicate counts, scalar types, and option interactions.
Run the comparison
Select Compare. Both inputs are parsed, their values are compared recursively, and the result page opens at /tools/compare-yaml/result in Data Compare view.
Result categories have these meanings:
- Added (green): a key, value, or sequence item exists only on the Contrast side.
- Deleted (red): a key, value, or sequence item exists only on the Base side.
- Value Changed (yellow): corresponding values differ while retaining the same parsed type.
- Type Changed: the parsed type differs, such as a number becoming a string when numeric-string equivalence is off.
Same means the parsed values are equal under the selected rules. It does not mean the original YAML text is byte-for-byte identical.
Read results on the original source
The Data Compare sidebar groups differences by category and shows value paths. Select an entry to reveal its location in the aligned editors, or use the category controls to focus the review.
Data Compare calculates differences from parsed values, then maps their paths back to lines in the original YAML source for display. The editors therefore retain source comments, quoting, key order, and layout while highlighting the associated lines. They are not a regenerated YAML serialization of the parsed values.
Use the two result views for different questions:
- Data Compare asks what changed in the parsed YAML under the selected rules.
- Git Diff asks what changed in the original text entered into each editor. It can show comments, formatting, quoting, and mapping-order edits that Data Compare treats as equal.
Semantic Settings are available in Data Compare. Switch back from Git Diff to change them and recalculate the structural result.
Sharing and sensitive data
Entering or pasting YAML for comparison does not upload it. Parsing and comparison run locally in your browser. Using Share uploads the compared content to the share server and creates a link to /tools/compare-yaml/result with a share_id; anyone with that link can load the stored snapshot until it expires.
Data placed in URL query parameters is sent with page requests and may be recorded in hosting logs, so do not place sensitive data in URLs. This applies to Base64-encoded YAML as well as remote source addresses. Importing from a URL also sends a request to the source you specify.
Troubleshooting
An editor reports invalid YAML
Check indentation, sequence dashes, quoted strings, and flow-style brackets. Remove surrounding log output or other non-YAML text so each editor contains only the document you intend to compare.
A comment or formatting edit is missing from Data Compare
This is expected when the parsed values are unchanged. Switch to Git Diff to review the original-source edit.
One insertion causes many sequence changes
By Index compares positions, so an insertion can shift every later item. Use LCS when order matters and existing items should remain aligned across insertions and deletions. Use Unordered only when order has no meaning; duplicate occurrence counts still matter.
A number and quoted numeric string look identical but differ
YAML types are significant by default: 8080 is a number and "8080" is a string. Enable Numeric String Equals Number only when that distinction is irrelevant for the field. Use Git Diff when the spelling and quoting themselves need review.
A URL import fails
Confirm that the Base and Contrast parameters or editor imports use accessible HTTP/HTTPS URLs. Check the response content type, YAML validity, authentication requirements, and CORS policy. For a Gist, verify that the link identifies accessible content.
Read YAML Comparison Rules to choose options from the meaning of the configuration rather than simply reducing the number of differences.
Browse the documentation
Find practical guides for comparison options, sharing, browser extensions, AI assistants, and language libraries.
Work with YAML
Follow a YAML-aware workflow and choose the right comparison rules.
Load & share comparisons
Open YAML comparisons from self-contained or remote-source links.