YAML to JSON
Convert YAML or .yml files to JSON instantly. Anchors, multi-document files and comments are handled, and errors show the exact line. Free, private, no upload.
Runs in your browser. Nothing is uploaded.
About YAML to JSON
YAML to JSON parses a YAML document and prints the same data as JSON, ready for an API request, a JavaScript app or a tool that only reads JSON. Anchors and aliases (& and *) are expanded, and comments are dropped because JSON has no place for them.
Files with several documents separated by --- become a JSON array with one entry per document. If the YAML is invalid, you get the line and column of the problem and a snippet showing where the parser stopped.
How to use YAML to JSON
- Type or paste your text into the input box. Press Sample to see an example.
- Adjust the options. The result updates as you type.
- Copy the result, or press Use as input to chain another transformation.
Frequently asked questions
What happens to YAML comments?
They are removed. JSON has no comment syntax, so there is nowhere to keep them.
Does it support multiple documents in one file?
Yes. A file with several --- separated documents becomes a JSON array, one item per document.
Will yes and no become true and false?
This uses the YAML 1.2 core schema, where only true and false are booleans. yes and no stay strings.
Is YAML to JSON free and private?
Yes. YAML to JSON is completely free with no sign-up. Everything runs in your browser, so whatever you type or paste never leaves your device.