Free online tool
Free Online YAML to JSON Converter
Convert YAML to JSON online for free. Handles YAML 1.2 including anchors, aliases, and multi-document files. Parse errors show exact line and column. Two-space indented JSON output. 100% client-side.
01How it works
Paste your YAML
Paste any YAML document. The converter handles indentation, anchors, aliases, and nested structures.
Click Convert
The YAML is parsed and the result is pretty-printed as JSON with two-space indentation.
Copy or download
Copy the JSON to clipboard or download it as output.json.
FAQ
Frequently asked questions
Are YAML anchors and aliases supported?
The converter uses js-yaml, which implements the YAML 1.2 specification. Anchors (&name) and aliases (*name) are resolved to their referenced values in the JSON output. Multi-document YAML (separated by ---) is not merged — only the first document is converted. Explicit tags like !!str are respected.
How are parse errors shown?
js-yaml reports parse errors with a line and column number (1-indexed). The error message shown in the tool includes this position so you can locate the problem immediately. Common causes: inconsistent indentation, tabs instead of spaces, or unquoted special characters like : and #.
How are YAML booleans and numbers handled in the JSON output?
YAML scalars are type-inferred: unquoted true/false become JSON booleans, unquoted integers become JSON numbers, and null/~/empty become JSON null. If you need a string like 'true', quote it in YAML. The output JSON faithfully reflects the inferred types.
Can I convert a multi-document YAML file (with --- separators)?
No. YAML's multi-document syntax (--- separator) is not merged into a JSON array by this converter. Only the first document in the input is processed. If you need to convert multiple YAML documents, split them and convert each one separately.
Need AI-powered document extraction?
This tool uses client-side processing. anyrow uses AI to extract structured data from PDFs, images, and scanned documents with 99% accuracy. 150 free extractions/month — no credit card required.