YAML to JSON
Convert YAML to JSON and validate it at once - clear line-numbered errors when the YAML is malformed. Runs entirely in your browser.
Convert and validate in one step
YAML is lovely to write but fiddly to get exactly right - a single stray space or a sneaky tab can change the meaning or break parsing entirely. Paste your YAML above and it is turned into JSON the instant you stop typing. If it converts cleanly it was valid; if not, you get the precise line and column of the first error instead of a vague failure.
Why the line number matters
Most YAML mistakes are structural: a list item indented under the wrong key, a value that should have been quoted, or a tab used where spaces are required. The parser reports exactly where it gave up, and the caret preview above points at that character - far quicker than re-reading the whole file. Remember YAML never allows tab characters for indentation, so a copied snippet with tabs will always be flagged.
Multiple documents
One YAML file can hold several documents separated by a --- line, which Kubernetes
uses constantly to bundle related resources. When the tool sees more than one, it returns a
JSON array with one entry per document and notes the count, so nothing is quietly lost. Switch
between Pretty and Minified output depending on whether you
want something readable or something compact.
Going the other way? Use the JSON to YAML converter. To tidy the result, reach for the JSON formatter, or convert a legacy feed with the XML to JSON converter.