YAML Validator
Check YAML text or files in your browser, find parser errors and duplicate-key risks, then inspect document counts, paths, and parsed JSON.{{ summaryTitle }}
Validation status
| Status | Field | Value | Detail | Copy |
|---|---|---|---|---|
| {{ row.status }} | {{ row.field }} | {{ row.value }} | {{ row.detail }} |
| Document | Path | Type | Preview | Copy |
|---|---|---|---|---|
|
No parsed paths available
Add YAML content with mappings, sequences, or scalar values to populate the path ledger.
|
||||
| {{ row.document }} | {{ row.path }} | {{ row.type }} | {{ row.preview }} | |
Introduction
YAML is often chosen because it lets configuration read like an outline, not like a dense data dump. That same readability can hide fragile details. Indentation changes ownership, a dash changes a mapping into a list item, and an unquoted word may be loaded as a string, boolean, number, null, date-like value, or binary value depending on the schema used by the loader.
Most YAML problems appear during handoff. A file that looks correct in a pull request can fail when a deployment system reads it, or it can load successfully while placing a value under the wrong parent. Human review focuses on visual layout, comments, and naming. Software review focuses on the loaded data graph: mappings, sequences, and scalars after syntax and schema rules have been applied.
| Review Area | What Changes The Answer | Common Mistake |
|---|---|---|
| Syntax | Indentation, colons, dashes, quotes, block scalars, and document markers. | A missing colon or uneven indentation stops parsing before structure can be trusted. |
| Structure | Mappings, sequences, nested depth, anchors, aliases, and multi-document streams. | A value appears valid but lands under the wrong parent or document. |
| Type resolution | The active schema decides how plain scalars are loaded. | on, 01, true, or a date-like value is not treated as the intended text. |
| Destination rules | The consuming platform may require fields, reject duplicates, or apply its own schema. | Valid YAML is mistaken for valid Kubernetes, CI, app, or policy configuration. |
YAML also has a boundary that plain text review cannot cross. Comments, original spacing, and scalar style explain intent to a person, but they do not become values in the loaded data. A destination system usually receives the parsed structure, not the helpful comments that surrounded it.
A useful YAML check therefore has two jobs. It should catch parser failures early, and it should make the loaded structure inspectable enough to catch wrong document counts, repeated keys, unexpected value types, and misplaced paths before the file reaches a deployment, build, or handoff process.
How to Use This Tool:
Use the validator as a parser-first review pass, then confirm the loaded paths against the system that will consume the YAML.
- Paste content into
YAML source, chooseBrowse YAML, drop a.yml,.yaml, or.txtfile, or useLoad sampleto see a multi-document example. - Pick a
Validation profile.Default YAML schemais the broad first pass,Core YAML schemais useful for YAML 1.2-style review,JSON-compatible schemakeeps the result closer to JSON value families, andFailsafe strings-only schemais useful when plain scalars should remain text. - Leave
Allow duplicate keysoff unless the target loader deliberately accepts later duplicate values. Strict review is safer for configuration, deployment, and policy files. - Use
Normalize LFwhen copied line endings make review noisy. The source is checked again after line endings are normalized. - Open
Advancedwhen output size matters.JSON preview spacingchanges only the readable JSON text, andPath preview limitcontrols how many path rows appear, from 50 to 2000. - Read the summary and
Validation Ledgerfirst.Valid YAMLmeans the selected profile loaded the source.Invalid YAMLincludes the parser message, location, and snippet when the parser provides them. - Use
Path Ledgerto check where important keys and list items landed. UseParsed JSONto inspect loaded values without comments or YAML formatting, andAudit JSONwhen you need a structured review record.
If the source is empty, larger than 2 MB, or unreadable as text, fix that input problem before interpreting paths, counts, or parsed JSON.
Interpreting Results:
Parser status is the hard gate. When it says Invalid YAML, the path table, document metrics, and parsed JSON cannot be used as evidence. Fix the line and column issue first, then rerun the same profile.
A pass is not the same as destination approval. Valid YAML means syntax and schema loading succeeded in the selected profile. It does not prove that a Kubernetes manifest, CI file, application config, or policy document contains the required fields or matches that platform's own rules.
| Result Cue | What It Means | What To Verify |
|---|---|---|
Documents |
The number of YAML documents loaded from the stream. | Unexpected counts usually point to an extra or missing --- marker. |
Nested keys and Depth |
The size and nesting shape of the loaded tree. | Check indentation when depth is higher than expected or a value appears under the wrong parent. |
Warnings |
Non-fatal conditions such as permissive duplicate-key handling, JSON-looking input, or capped path output. | Resolve warnings before using the YAML as release or deployment evidence. |
Parsed JSON |
The loaded YAML value serialized as JSON for inspection. | Use it to check values and types, not comments, source order, or original formatting. |
When the file controls infrastructure, permissions, secrets, or release behavior, compare the parsed paths with the target system's own validator or dry-run output before trusting the result.
Technical Details:
YAML loading turns a character stream into documents and then into a representation made of mappings, sequences, and scalars. The parser must first recognize indentation, collection markers, scalar styles, anchors, aliases, tags, and document boundaries. Only after that step can the loader resolve plain values into concrete data types.
The validator is rule-based rather than formula-based. The important mechanism is the ordered parse and inspection path, not arithmetic. A Rule Core fits better than a Formula Core because the output depends on parser success, selected schema, duplicate-key handling, and traversal boundaries.
Rule Core
| Stage | Rule | Visible Evidence |
|---|---|---|
| Normalize source | A leading byte order mark is removed, and CRLF or CR line endings are treated as LF for parsing. | Source size, line count, and longest line describe the checked text. |
| Enforce size | Sources above 2 MB stop before parsing. | The status changes to a source-size error. |
| Load documents | The parser loads every document in the stream under the selected schema profile. | Parser status, Location, and Documents show pass, failure, or empty-stream behavior. |
| Resolve duplicates | Duplicate mapping keys are rejected by default. Override mode allows later matching keys to replace earlier ones. | Validation profile and Warnings record strict or permissive behavior. |
| Walk loaded data | Loaded documents are traversed into document numbers, paths, type labels, previews, counts, and maximum depth. | Path Ledger, Parsed paths, Nested keys, and Scalar values expose the resulting shape. |
Schema Profiles
Schema choice matters most for unquoted scalars. Quoting remains the clearest way to force a value to load as text when the receiving system is strict about types.
| Profile | How Plain Values Are Treated | When It Helps |
|---|---|---|
Default YAML schema |
Broad YAML loading with common typed scalars. | General configuration review before a destination-specific check. |
Core YAML schema |
Core YAML value handling closer to the YAML 1.2 recommendation. | Compatibility review where legacy implicit typing is a concern. |
JSON-compatible schema |
Value families stay closer to JSON objects, arrays, strings, numbers, booleans, and null. | Files intended to behave like JSON with YAML syntax conveniences. |
Failsafe strings-only schema |
Mappings and sequences still load, while plain leaf values are kept as strings. | Reviewing structure when numeric, boolean, date-like, or null-looking text must stay text. |
Path And Preview Boundaries
Path rows use dot notation for simple mapping keys and bracket notation for array positions or quoted keys. A path such as spec.template.spec.containers[0].image is useful because it shows the loaded address, not just the source indentation.
| Boundary | Value | Effect |
|---|---|---|
| Source size | 2 MB maximum | Larger text or files are rejected before parsing. |
| Visible path rows | 50 to 2000 rows | The path table can be capped while counts and warnings still describe the larger load. |
| Default path preview | 300 rows | The first review view stays responsive for ordinary configuration files. |
| Tree walk | 12000 nodes | Traversal stops at this limit and reports a warning. |
| Path preview text | 120 characters | Long scalar previews are shortened in rows; full loaded values belong in the parsed JSON view. |
A single YAML document is shown as one JSON value. A multi-document stream is shown as an array of document values. Date-like loaded values become ISO strings, binary values become byte-count summaries, and circular alias references are replaced with a clear placeholder so the JSON preview can still render.
Privacy And Accuracy Notes:
Pasted YAML and selected files are parsed in the browser after the page has loaded its parser support. The validation pass does not upload the source for server-side checking.
- Local syntax validation does not check required fields, platform schemas, admission rules, referenced resources, permissions, or organization policy.
- Different YAML loaders may disagree on custom tags, legacy scalar behavior, duplicate keys, timestamps, or binary values.
- Use a trusted browser profile when reviewing private configuration, secrets, credentials, or deployment material.
Advanced Tips:
- Use
Failsafe strings-only schemawhen you suspect a value such as01,true,off, or2026-05-06is being loaded as the wrong type. - Keep
Allow duplicate keysoff for release review. Turn it on only to compare behavior with a permissive loader, then keep the warning with your review notes. - Raise
Path preview limitwhen a large file parses cleanly but the key you need is missing from the visible rows. - Use
Parsed JSONto compare two schema profiles. The source text may look identical while the loaded value types differ. - Run a destination-specific check after parser success for Kubernetes, CI, cloud, application, or policy files.
Worked Examples:
Two-document deployment handoff
A manifest followed by --- and a second owner or checks document should report Valid YAML with Documents equal to 2. The Path Ledger should show paths for the container image, resource limits, health check path, and owner fields, which confirms that both documents loaded separately.
Repeated setting in a config block
A block that repeats the same key at the same indentation should fail strict review when Allow duplicate keys is off. If override mode is turned on for comparison, the later value can win, but the warning still matters because another loader may reject the file or handle the duplicate differently.
Text that looks like another type
A settings file with enabled: true, build: 01, and date: 2026-05-06 can be checked with Failsafe strings-only schema when the receiving application expects those leaf values as text. Use Parsed JSON to confirm whether the loaded values changed type under another profile.
Parser error after a paste
A pasted snippet with a missing colon after metadata or an unclosed quote under image changes the status to Invalid YAML. Use the reported line, column, and snippet, correct the source, and wait for Parser status to return to Valid YAML before using path rows as evidence.
FAQ:
Does valid YAML mean my config is correct?
No. Valid YAML means the selected profile loaded the text. It does not check destination schemas, required fields, cloud permissions, admission rules, secret policy, or referenced resources.
Why did JSON parse as YAML?
YAML 1.2 is closely aligned with JSON syntax, so JSON-looking flow input can load as YAML. The warning helps you decide whether to follow up with a JSON-specific validator.
Why did duplicate keys fail?
Duplicate mapping keys are rejected by default because they make ownership unclear. Allow duplicate keys is available for permissive loader comparisons, but it records a warning because the behavior is not portable.
Why is the Path Ledger shorter than the parsed path count?
Path preview limit controls the visible rows, from 50 to 2000. When the loaded tree has more nodes, the warning reports the displayed count and the parsed count.
Are comments preserved in Parsed JSON?
No. Comments and source spacing belong to the YAML presentation stream. Parsed JSON shows loaded values and types, not comments, original scalar style, or formatting.
Glossary:
- YAML stream
- The source text that may contain one or more YAML documents.
- Document marker
- A line such as
---that can begin a separate document in the same stream. - Mapping
- A key and value collection, similar to an object or dictionary.
- Sequence
- An ordered list, often written with dash-prefixed items.
- Scalar
- A single loaded value, such as text, a number, a boolean, null, a date-like value, or binary data.
- Duplicate key
- A repeated mapping key at the same level, which strict validation treats as an error.
- Schema profile
- The selected rule set used to resolve untagged YAML values into loaded data types.
References:
- YAML Ain’t Markup Language Revision 1.2.2, YAML Language Development Team, 2021-10-01.
- RFC 8259: The JavaScript Object Notation Data Interchange Format, RFC Editor, December 2017.