YAML to JSON

Parse YAML into formatted JSON. Multi-document YAML (--- separators) converts to a JSON array. Maximum input is 512 KB — same limit as YAML format/validate tools.

  • Runs entirely in your browser
  • No data stored or sent to a server
  • Free forever — no signup
  • Instant conversion

Input and Output

Use the interactive encoder and decoder on this page to process your text.

Learn more about YAML to JSON conversion

How to Convert YAML to JSON

YAML to JSON

When to Convert YAML to JSON

Parse YAML configs into JSON for JavaScript apps, API requests, and tools that expect JSON input. Useful when debugging Kubernetes manifests or CI workflow files in a JSON-native environment.

Real-World Examples

docker-compose.yml → JSON for programmatic inspection

GitHub Actions workflow YAML → JSON for schema validation

Ansible vars file → JSON for API upload

Common Mistakes

  • Multi-document YAML with --- separators converts to a JSON array — a warning is shown when multiple documents are present
  • Tabs in indentation — YAML requires spaces
  • Assuming YAML anchors and aliases expand the same in all parsers

Developer Tips

  • Validate YAML syntax before converting
  • Format JSON output for readable diffs
  • Watch for implicit type coercion (booleans, null, numbers)

Frequently asked questions

Does this support multi-document YAML?

Yes. Multi-document YAML (--- separators) converts to a JSON array with a warning when more than one document is present.

Are comments preserved?

No. YAML comments are discarded during conversion to JSON.

How are YAML null values represented?

YAML null becomes JSON null. Empty values may map to null depending on YAML structure.