YAML Validator
Paste any YAML document and the validator reports whether the syntax is well-formed. Errors include the line and column where the parser stopped, making it easy to locate the problem.
Input YAML
Output
ACTION
INDENT
Runs entirely in your browser
How it works
The tool uses js-yaml, a YAML 1.2 parser written in pure JavaScript. The library runs in a Web Worker that starts when the page opens; it parses the input into an in-memory tree and re-emits it using the chosen indentation. Validation surfaces any parser error along with the line where it occurred.
Processing runs in your browser
All parsing and conversion happens locally in your browser tab. Our servers are not involved at any point.
Frequently asked questions
- What kind of errors does the validator catch?
- Indentation mismatches, duplicate keys, unterminated strings, invalid escape sequences, and any structural issue that prevents the document from parsing.
- Does the validator check semantic rules like Kubernetes schemas?
- The validator confirms YAML syntax only. Schema-level rules for Kubernetes, OpenAPI, or other formats require a separate schema validator.
- Why does the validator say my file is invalid when it looks fine?
- The most common cause is a tab used for indentation: YAML allows only spaces there, and the parser stops with 'tab characters must not be used in indentation'. Other frequent causes are a key repeated in the same mapping ('duplicated mapping key'), a quote that is never closed, and a line indented one space more or less than its siblings ('bad indentation of a mapping entry'). The first line of the message ends with the line and column, for example (2:1), and the lines below it point to the spot.
- Why does a CloudFormation template fail with an unknown tag error?
- The validator parses with js-yaml's JSON schema, which knows mappings, lists, strings, numbers, booleans and null and their standard tags such as !!str. Custom tags such as CloudFormation's !Ref, !Sub and !GetAtt, and YAML 1.1 types such as !!binary, !!set and !!timestamp, stop the parse with 'unknown tag' even though CloudFormation accepts the short forms. Rewrite them in long form (Ref: or Fn::GetAtt:) to check the rest of the file.
- Does the validator check every document in a multi-document file?
- Yes. Every document separated by --- is parsed. A valid file with three documents reports 'Valid YAML. All 3 documents parsed successfully.', and an error gives the line and column counted from the start of the whole file.
Last reviewed September 30, 2026
Other pages for this tool
Related tools
XML formatter
Pretty-print, minify, and validate XML. Uses the browser's native DOMParser.
JSON formatter
Pretty-print, minify, validate, and sort JSON keys. Instant output.
SQL formatter
Beautify and format SQL queries. Supports MySQL, PostgreSQL, T-SQL and standard SQL.
CSV ↔ JSON
Convert CSV to JSON and JSON back to CSV. Handles quoted fields and downloads.
- Background reading: Complete guide to developer tools