YAML Validator
Validate YAML syntax, catch indentation and duplicate-key errors, and preview the parsed data as JSON.
How to use this tool
Steps for using the YAML Validator.
- Paste YAML into the Input YAML panel — a Kubernetes manifest, a docker-compose file or a CI pipeline — or click Sample to load a valid Deployment and Service.
- Click Validate YAML. Multi-document files separated by
---are supported, and the document count is shown. - If there are problems, each error shows its line and column, a plain-English message and an excerpt with a caret under the exact position. The first error line is highlighted in the editor.
- Fix the issues — Sample with errors shows typical ones: a duplicate key and a tab used for indentation.
- When the YAML is valid, review the parsed data in the Parsed JSON panel and Copy or Download it as
parsed.json.
Example
A duplicate key in a compose file
services:
web:
image: nginx
image: httpdError at line 4, column 5 (document 1)
Duplicate key "image" — keys in the same mapping must be unique.
3 | image: nginx
4 | image: httpd
| ^Common use cases
- Checking a Kubernetes manifest or Helm output before
kubectl apply. - Debugging a GitHub Actions or GitLab CI pipeline that fails with a vague YAML error.
- Finding a duplicate key that silently overrides a docker-compose setting.
- Converting YAML configuration to JSON to inspect it or feed it to other tools.
- Reviewing multi-document files to confirm each resource parses as intended.
How YAML validation works
YAML represents the same data as JSON — mappings, sequences and scalars — but uses indentation instead of braces. That makes it pleasant to read and easy to break: a single misplaced space can move a key to a different parent or turn a mapping into a string. Validation parses the text with the yaml library (YAML 1.2 core schema), collects every error and warning with its position, and only when the document is clean converts it to plain data and shows it as JSON, so you can see exactly what your application will receive.
Two mistakes cause most invalid YAML. Tabs: YAML forbids tab characters for indentation, but editors often insert them silently; the validator reports *"Line N is indented with a tab character"* rather than a generic parse error. Tabs inside block scalars (| or > text) are legal content, so those are reported only as warnings. Duplicate keys: the YAML spec requires keys in a mapping to be unique, yet many parsers silently keep the last value — a duplicated env or image key can override configuration without anyone noticing. This validator always treats duplicates as errors.
Files can contain several documents separated by ---, which is common for Kubernetes manifests that bundle a Deployment, a Service and a ConfigMap. Each document is validated separately and errors name the document they belong to. The JSON preview is a single value for one document and an array for several. The statistics show the number of documents and the top-level key count of each mapping — a quick way to spot a document that was accidentally merged into another.
Anchors and aliases (&defaults / *defaults) are resolved in the preview, and an alias without a matching anchor is reported. To protect your browser, alias expansion is capped, so "billion laughs" style inputs fail with an error instead of freezing the tab. Validation checks syntax and structure only — it does not know whether replicas should be a number in a Kubernetes manifest. For schema-level checks, convert to JSON and use the JSON Schema Validator.
Limitations
- Syntax and structure only: Kubernetes, Compose or CI schemas are not checked.
- Custom tags such as
!Refin CloudFormation are reported as unresolved and kept as strings. - YAML 1.1-only features (e.g.
yes/noas booleans, sexagesimal numbers) follow YAML 1.2 rules and stay strings. - Comments are not included in the JSON preview, and input is limited to 2 million characters.
Frequently asked questions
Why are tabs not allowed in YAML?
The YAML specification forbids tabs for indentation because their width is ambiguous across editors. Configure your editor to insert spaces for .yaml and .yml files; two spaces per level is the common convention.
Does this validate Kubernetes manifests?
It validates that the YAML is well-formed and shows the parsed structure, which catches most indentation and duplicate-key mistakes. It does not check Kubernetes field names or types — use kubectl apply --dry-run=server or a schema validator for that.
What is the difference between YAML and JSON?
YAML 1.2 is a superset of JSON: every JSON document is valid YAML. YAML adds comments, indentation-based structure, multi-line strings, anchors and multiple documents per file. Convert between them with the JSON to YAML converter.
How do I validate multiple documents in one file?
Separate them with a line containing only ---. The validator reports the number of documents, attributes each error to its document and shows the parsed result as a JSON array.
Is my YAML sent to a server?
No. Parsing and validation run entirely in your browser.