Skip to content

Convert YAML configuration and data structures into valid, formatted JSON documents.

Loading tool

About YAML to JSON Converter

Convert YAML into JSON with 2 or 4 space indentation or minified output, and optional key sorting. Anchors, aliases, block scalars and comments are handled, and syntax errors are reported with the line and column. Only the first document in a multi-document YAML stream is converted.

Common uses

  • Convert a Kubernetes manifest or GitHub Actions workflow to JSON
  • Validate YAML syntax and locate indentation errors
  • Feed a YAML config to a tool or API that only accepts JSON
  • Expand YAML anchors and aliases to see the resolved values

FAQ

What happens to YAML comments?
JSON has no comment syntax, so comments are discarded during conversion.
How are YAML anchors and aliases converted?
Aliases are resolved, so the referenced content is copied into each place it is used in the JSON output.
Why does my YAML fail with an indentation error?
YAML structure is defined by indentation and tabs are not allowed for indenting. Check that items at the same level line up exactly and that list items and keys use spaces only.