YAML to JSON Converter
Convert YAML to formatted JSON with line-numbered errors, anchors and multi-document support.
Supports mappings, sequences, flow collections, quoted strings, block scalars (| and >), anchors, aliases and merge keys. Custom tags are ignored.
Convert YAML to JSON
YAML is the readable data format behind docker-compose, Kubernetes manifests, GitHub Actions workflows, Ansible and many config files. To send that data to an API, validate it against a JSON schema or process it in JavaScript, you may need JSON.
Supported YAML features
- Mappings, lists and nested structures
- Multi-line block scalars (| and >)
- Anchors (&), aliases (*) and merge keys (<<)
- Multiple documents separated by ---
Clear errors
YAML is indentation-sensitive and a small mistake can invalidate a whole file. The tool shows the line number of the error so you can fix it quickly. Conversion happens in your browser, so configs containing secrets are never sent anywhere.
How to use YAML to JSON Converter
- Paste your YAML content.
- The tool parses it and converts it to JSON.
- If there's an error, fix it using the line number.
- Copy the JSON output.
Why use this tool?
Validate and convert configuration files quickly in DevOps and development work.
FAQ
Why do I get an error about tab characters?
YAML forbids tabs for indentation. Replace tabs at the start of lines with spaces.
Can I convert JSON to YAML?
This tool converts YAML to JSON. Since JSON is valid YAML, most systems can read JSON directly.
How are multiple documents output?
Each document separated by --- becomes an item in a JSON array.
Related tools
JSON Formatter and Validator
Pretty-print messy or minified JSON and find errors with line and column details.
Open toolJSON to TypeScript Converter
Generate TypeScript interfaces or types from JSON, including nested objects, arrays, optional and null fields.
Open toolXML Formatter and Validator
Indent XML documents for readability and check that they're well-formed.
Open toolJSON Minifier
Remove all unnecessary whitespace from JSON for smaller, faster-to-transfer data.
Open tool