Tabs, flow braces, anchors and multiline | blocks are rejected on purpose. A file that needs those features needs a full parser. This page will say so instead of guessing.
How to use
- Paste the YAML. Use spaces, not tabs.
- Press Check. A valid file reports how many keys and dash items it saw.
- A tab is an error on the line where it appears. Reset restores the soup sample.
Formula / how it works
What is accepted. A line that is empty or a comment starting with # is skipped. A line that is "- " plus text is a list item. A line that starts with a letter or underscore, then a colon, is a key. The indent before the line must be a multiple of two, including zero. Keys and items may be nested by that indent. The sample has two keys and two list items across four lines, and the status is valid for this subset. The last line of a valid result repeats the limits so a copied report still says what was not checked.
What is rejected. A tab anywhere is invalid, with the line number. The file "title: Soup" followed by a tab and "serves: 2" fails on line 2 for the tab, even though a full parser might have accepted a tab as indent. An indent of one or three spaces fails. A line that is neither a key nor a dash item fails, which is how "bad" under a key is reported. Braces, anchors, and a pipe block are in that same bucket. The YAML to JSON converter is a different page. This one does not emit JSON. It only says whether the subset’s shape holds.
Line numbers. They start at 1 and count blank lines. A comment near the top moves the number of a later error. The reason text names the rule that failed, not a generic parse exception.
A file that is valid here can still fail a full YAML parser, and a file that a full parser accepts can fail here. The subset is a teaching check for the shape most small config files use. If you need anchors or a folded block, take the file to a real parser after this page has confirmed the indents and the colons. The line number counts from 1 and includes blank lines, so a comment near the top still shifts the number of the broken line.
Worked files should stay inside the subset while you are learning the shape. Write a key, a colon, a space and a value. Put a dash list under it with two spaces of indent. Run the check. Then, and only then, open a full parser if the real file needs a feature this page names as rejected. Copy the reason line into a note so you remember whether the failure was a tab or a bad indent. Those two failures look similar in a text editor that paints tabs as spaces. The reason line is how you tell them apart without changing the editor’s settings.
Worked examples
A small menu
Inputs: YAML: title: Soup, serves: 2, dash carrot, dash onion
Paste title: Soup then serves: 2 then a dash carrot and a dash onion, each on its own line, and press Check. Two keys and two list items.
Result: Status: valid for this subset
Keys: 2
List items: 2
Lines: 4
Accepted here: indented keys and dash lists. Not accepted: tabs, braces, anchors, or multiline | blocks.
A tab in the indent
Inputs: YAML: title: Soup then a tab before serves: 2
Paste title: Soup on the first line and a tab before serves: 2 on the second, then press Check. The tab is the reason on line 2.
Result: Status: invalid
Line: 2
Reason: a tab was used for indent. This subset allows spaces only.
Use cases
- Catching a tab before you hand a file to a stricter parser.
- Counting keys and dash items in a small config.
- Teaching that this subset is not all of YAML.
- Seeing a line number that includes blank lines.
Tips & limitations
- Replace tabs with two spaces before you trust a valid result.
- Do not use this as a schema check.
- Anchors and pipe blocks are out of scope on purpose.
- A valid subset file can still fail a full parser if you later add those features.
FAQ
Is this a full YAML parser?
No. Keys, dash lists, comments and even indents. Tabs, braces, anchors and pipe blocks are rejected.
Why are tabs invalid?
This subset allows spaces only, so a tab is reported rather than treated as indent.
Does a valid result mean every YAML tool will accept the file?
No. It means this subset’s rules held. A full parser may still disagree once you add features this page refuses.
Are blank lines counted?
Yes. Line numbers start at 1 and include blank lines and comments.
Will it convert YAML to JSON?
No. That is a different page. This one returns a status.
Is the file uploaded?
No. The check runs in the browser.
Runs entirely in your browser; nothing is uploaded. Check the output before you rely on it in production code, data or security decisions.