YAML to JSON Converter

Convert YAML to formatted JSON with line-numbered errors, anchors and multi-document support.

Runs in your browser Free
Indent
Processed locally in your browser.

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

  1. Paste your YAML content.
  2. The tool parses it and converts it to JSON.
  3. If there's an error, fix it using the line number.
  4. 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