YAML Validator & Formatter
Validate YAML, catch tabs, duplicate keys and the implicit-typing traps, and see a normalised version with consistent indentation.
Findings
Import from File
Drag & drop a file here
or
Supports .txt, .csv, .log, .json and other text files
Validation and normalisation run entirely in your browser. Note that comments are not preserved in the normalised output — they are not part of the parsed data.
What It Does
This checks YAML for the mistakes that YAML specifically invites, then shows you a normalised version with consistent indentation. The validation is the more valuable half. YAML's flexibility is also its hazard: indentation carries meaning so a tab silently breaks the structure, duplicate keys are accepted by most parsers which quietly keep the last one, and a set of bare words are implicitly converted to booleans and numbers in ways that surprise almost everyone the first time. This tool reports each of those against your actual document rather than describing them in the abstract. The normalised output re-indents everything consistently and quotes the values that would otherwise be misread — with one honest caveat, stated up front: comments are not preserved, because they are not part of the parsed data.
When to Use It
- A CI pipeline is rejecting your workflow file with an unhelpful parse error and you need to know which line is actually at fault.
- A configuration file behaves differently from what it appears to say and you suspect a duplicate key is overriding something.
- A list of country or region codes is misbehaving and you want to see which entries YAML is silently turning into booleans.
- You inherited a file with inconsistent indentation and want it normalised before committing a change to it.
- You are checking machine-generated YAML before it goes into a deployment.
Worked Examples
countries:
- NO
- SE
- DK
The Norway problem in three lines. NO parses as the boolean false rather than the string "NO", so the list is not what it appears to be. The tool flags it and the normalised output quotes it.
server:
port: 8080
host: localhost
server:
port: 9090
A duplicate key, the kind that survives a careless merge. Most parsers accept this silently and keep 9090, so the first block is simply ignored — which is exactly the sort of thing that costs an afternoon.
version: 1.20
enabled: yes
code: 0755
Three implicit-typing traps at once. The version becomes the number 1.2 and loses its trailing zero, yes becomes a boolean, and the leading zero makes the code an octal number.
Features
How to Use
1. Paste your YAML into the input box. 2. The verdict appears immediately, with the line number if it fails to parse. 3. Read the findings for tabs, duplicate keys and implicit typing risks. 4. Adjust the indent width if you want the normalised output to match your house style. 5. Copy the normalised version, remembering that comments are not carried over.
Common Mistakes
- Indenting with tabs. YAML forbids them outright, and the resulting parse error rarely points at the real problem — set your editor to use spaces for YAML files.
- Leaving version numbers and codes unquoted. 1.20 becomes 1.2, 0755 becomes an octal, and a leading-zero identifier loses its zero, all without any warning.
- Assuming duplicate keys will be rejected. Most parsers keep the last one and say nothing, so a stray repeated key silently overrides configuration above it.
- Pasting normalised output back over an annotated config file. Comments are not part of the parsed data, so they do not survive the round trip.
- Trusting that two YAML parsers agree. The specification is large enough that implementations differ at the edges, so validating here is a good check but not a guarantee for every consumer.