Paste YAML and click Convert. The tool uses the js-yaml library to parse your YAML document and output valid, pretty-printed JSON. Handles real-world YAML including anchors, multi-line strings, and type tags.
Free, fast, runs in your browser. No login needed.
This tool uses js-yaml 4.1.0, a widely-used, spec-compliant YAML parser. It handles the full range of YAML features that appear in real configuration files:
&anchor and *alias references are resolved during parsing, producing the expanded value in JSON.|) and folded (>) scalars are parsed correctly.!!str, !!int, !!bool, !!null, !!float type tags are respected.2024-01-15) are parsed as JavaScript Date objects and become ISO string values in the JSON output.Important: YAML is a superset of JSON. Any valid JSON is also valid YAML, so you can paste JSON into this tool and it will pass through correctly.
Output format. The JSON output is formatted with 2-space indentation via JSON.stringify(result, null, 2). Use the JSON Formatter if you prefer a different indent width, or the JSON Minifier to strip whitespace.
Common use cases: converting a Kubernetes manifest or Docker Compose file for programmatic inspection; converting Ansible variable files or GitHub Actions workflow YAML to JSON for querying; migrating data between YAML and JSON-native systems.
Full YAML 1.2 via js-yaml: anchors and aliases, multi-line block and folded scalars, type tags (!!str, !!int, !!bool, etc.), nested mappings and sequences, and multi-document files (only the first document is parsed).
Anchors and aliases are expanded by the parser. The JSON output contains the full resolved value at every alias location — there are no references in JSON.
Yes. Use the JSON to YAML tool on this site.
js-yaml's load() function reads the first document only. Multi-document YAML streams are not merged into a JSON array.
No. The conversion runs entirely in your browser using the bundled js-yaml library.