YAML Validator: Lint YAML and List Every Error
Paste YAML or open a file to get every syntax error and lint warning at once, each with its line, column, and a code frame. It catches tabs, duplicate keys, the YAML 1.1 “Norway problem”, octal and base-60 surprises, undefined aliases, and alias bombs, and shows how each document resolves to JSON under YAML 1.2 and 1.1. Everything runs in this page; nothing is uploaded.
Ctrl+Enter (or Cmd+Enter) validates. You can also drop a file here. Files are read locally.
- Errors
- 0
- Warnings
- 0
- Documents
- 0
- Lines
- 0
Problems
Select a problem to highlight its location in the input. The arrow symbol in code frames marks a tab character.
Nothing checked yet.
Resolved values as JSON
Rules, severities, and limits
How it works and its limits
- A hand-written parser reads the whole stream: block and flow collections, plain, quoted, literal and folded scalars (with chomping and indentation indicators), anchors, aliases, merge keys, tags,
%YAMLand%TAGdirectives, comments, and documents separated by---and.... - After a syntax error the parser skips to the next line it can make sense of and keeps going, so you see more than the first problem. Fix the first error first: later messages can be side effects of it.
- YAML 1.1 vs 1.2. YAML 1.1 (PyYAML, Ruby Psych, go-yaml v2, many older tools) reads
yes,no,on,offas booleans,0755as octal,1:20as base 60, and2024-05-01as a date. The YAML 1.2 core schema treats all of those as strings, except0755, which becomes decimal 755. That is whycountry: NOcan turn intofalse. The truthy, octal, and base-60 rules apply even under%YAML 1.2, because many 1.1 parsers ignore that directive. - The 1.1 preview follows the YAML 1.1 type repository, which includes
yandnas booleans (PyYAML does not). Merge keys (<<) are applied in both previews. JSON cannot represent.infor.nan, so they appear as the strings"Infinity"and"NaN". Timestamps appear as ISO strings, and integers beyond 253 keep their exact digits. - Duplicate keys are compared after YAML 1.2 resolution, so
16and0x10count as the same key, but1and"1"do not. - Aliases are never expanded past the alias expansion limit, so a “billion laughs” file is reported instead of freezing the page.
- Custom tags such as
!Refor!referenceare accepted, and the value underneath is shown untagged. This tool does not check schemas: it will not tell you that a Kubernetes field name is misspelled. It also does not reformat YAML; use a formatter for that. - This parser has not been certified against the official YAML test suite. A few rare constructs, such as multi-line implicit keys inside flow collections or unusual flow indentation, may be accepted or rejected differently by your parser.
- Your input stays in this page. Nothing is uploaded or saved, and reloading the page clears it.