Skip to content

Menu

YAML Validator

Validate YAML syntax, show errors with line numbers, and display parsed tree structure.

Runs entirely in your browserFormattersFree, no sign-up
Loading tool

01What is YAML Validator?

YAML looks friendly until one stray space turns a list item into a parse error, or a value you meant as text quietly becomes a number. This validator answers two questions. Does the file parse at all, and if it does, what did the parser actually read? Paste your YAML and click Validate. The text goes through a compact parser that follows the YAML 1.2 core schema, the version of the spec published at yaml.org. It handles nested mappings and lists, inline [a, b] and {a: 1} collections, single and double quoted strings, | and > block scalars, comments, anchors, aliases and << merge keys. Under the 1.2 rules, yes, no, on and off are plain strings. Only true, false, null, ~ and numeric forms such as 8080, 1.5 or 0x1F get special types. When parsing fails, you get a line number and a short reason. Typical ones are unexpected indentation, tabs used for indentation, an unterminated quoted string or a missing ] in a flow sequence. Only the first syntax error in each document is shown, so fix it and validate again. Duplicate keys in the same mapping are flagged too, with the line where the key first appeared. The spec says keys must be unique, yet many parsers just keep the last value without a word. A file with several documents split by --- lines is checked one document at a time. The tree then lists them as Document 1, Document 2 and so on. Here is a quick example. Paste country: NO, port: 8080 and version: 1.10 on three lines. The tree shows country as "NO" in quotes, port as 8080 without quotes and version as 1.1. That last one surprises people. The trailing zero is gone because 1.10 is read as a float, so quote it if it is a version string. In the tree, strings carry double quotes while numbers, booleans and null do not. Anchors and merge keys show up already expanded. Branches deeper than three levels start collapsed, and the arrow opens them. Some limits are deliberate. Plain text that wraps onto more-indented lines is joined into one string. A custom tag such as !point gets a note saying it isn't applied, and its value is checked as written. A !!binary value must be valid base64 and a !!timestamp must be a real date and time, otherwise the tag gets the same note. Explicit ? keys are read, and a key that is a list or map appears in the tree as JSON text, with a note giving its line. The parser is also more lenient than the spec in one spot. A plain value containing a second colon and space, like msg: hello: world, is accepted here, while stricter parsers such as PyYAML reject it. Quote such values anyway. The YAML you paste is parsed by script in this browser tab and is never uploaded.

DevOps engineers validating infrastructure configuration, backend developers debugging YAML configs, and platform engineers reviewing Kubernetes manifests. The tool runs entirely in your browser, so your data never leaves your device.

02How to use YAML Validator

  1. Paste your YAML into the YAML Input box.
  2. Click Validate.
  3. If errors are listed, jump to each line number given and fix the problem, then validate again.
  4. When the badge says the YAML is valid, read the Parsed Structure tree and expand collapsed branches with the arrow.
  5. Click Reset to clear the input and start over.

03Worked examples

Input: country: NO port: 8080 version: 1.10 on: yes
Result: Valid country: "NO" port: 8080 version: 1.1 on: "yes"
YAML 1.2 keeps NO and yes as strings. 1.10 becomes the float 1.1, so quote it if you meant a version.
Input: a: 1 b: 2 a: 3
Result: Line 3: Duplicate key "a" (first used on line 1); YAML requires keys in a mapping to be unique
Many parsers would quietly keep a: 3. Here it is an error.
Input: items: - one - two
Result: Line 3: unexpected indentation
One extra space puts the second item at a different level from the first.
Input: key: value indented: tab
Result: Line 2: tabs are not allowed for indentation in YAML
Input: tags: [web, api x: 1
Result: Line 1: expected , or ] in flow sequence
The inline list was never closed.
Input: base: &b host: db port: 5432 prod: <<: *b host: prod-db
Result: Valid base: host: "db" port: 5432 prod: host: "prod-db" port: 5432
The merge key copies port from the anchor, and the local host overrides the merged one.

04Common use cases

  • Checking a multi-document Kubernetes manifest before running kubectl apply, so a bad indent in the Service doesn't stop the whole file
  • Finding why a GitHub Actions workflow fails to load after you nested a step one space too deep
  • Spotting a duplicate key in a Helm values.yaml where the second value was silently overriding the first
  • Confirming that a Docker Compose port or version field is read as a string and not a number
  • Seeing how an anchor and << merge key expand before you rely on them in a CI config
  • Catching a tab character pasted from a chat message or wiki page into an Ansible vars file

05Tips

  • Quote values like "1.10", "0123" or "NO" if every tool reading the file must treat them as text. YAML 1.1 parsers turn NO into false.
  • An unexpected indentation error often points one line after the real mistake, so check the line above too.
  • Use a | block scalar for multi-line text such as scripts. Plain text that wraps to the next line is accepted, but it is joined into one line.
  • Hex like 0x1F is read as the number 31, which can bite you in colour or ID fields. Quote it to keep the text.

06Related concepts

YAML 1.2, YAML anchors, Kubernetes manifest, Helm templates.

Frequently Asked Questions

What is YAML Validator?

YAML Validator is a free, browser-based developer tool on AIDToolStack. Validate YAML syntax, show errors with line numbers, and display parsed tree structure. It requires no installation or sign-up and works entirely in your browser.

Is YAML Validator free to use?

Yes. No sign-up, no fees and no usage cap.

Does YAML Validator store my data?

No. It runs in your browser; nothing is uploaded.

Cheat sheet

Related Tools

Reviews and commentsShow

Reviews

Sign in to leave a review.

Loading reviews…

Comments

Sign in to leave a comment.

Loading comments…

What changed in AI dev tools, once a month

Renames, shutdowns, pricing changes and new MCP setups, each with a source.

Subscribe