Data Converter

JSON ↔ YAML Converter

Convert JSON to YAML for Kubernetes manifests and CI/CD configs, or turn YAML back into JSON.

YAML Output
Output will appear here

Convert JSON to YAML and YAML to JSON

YAML is the format of choice for Kubernetes manifests, Docker Compose files, GitHub Actions workflows, Ansible playbooks, and countless other configuration files — while JSON remains the default for APIs and JavaScript-native tooling. This tool converts cleanly between the two so you don't have to hand-edit indentation-sensitive YAML from scratch.

What's supported

  • Block-style mappings and sequences (the common, indentation-based YAML style used in almost every real config file).
  • Flow-style collections, e.g. tags: [a, b, c] and {key: value}.
  • Quoted and unquoted scalars, numbers, booleans (true/false/yes/no), and null/~.
  • Comments (#) when converting YAML → JSON — they're simply ignored, as they have no JSON equivalent.
  • Nested objects and lists of objects, including deeply nested structures.

This parser covers the YAML syntax used in the vast majority of real-world config files. It does not support advanced YAML features like anchors & aliases (&anchor / *ref), multi-document files (--- separators), or block scalar literals (| and >). For files using those features, a language-specific YAML library is more reliable.

Typical use cases

  • Kubernetes & DevOps: Draft a manifest as JSON (easier to generate programmatically) and convert it to YAML before applying it.
  • CI/CD configuration: Convert a GitHub Actions or GitLab CI YAML file to JSON to process it with a script.
  • API responses in config form: Turn a JSON API response into a readable YAML snippet for documentation.
  • Migrating between tools: Some tools accept only JSON, others only YAML — convert on the fly instead of retyping by hand.

For a deeper look at when to reach for each format, see YAML vs JSON: When to Use Which.

Frequently Asked Questions

Not for multi-document files separated by ---. Convert one document at a time by splitting the file first.
No — JSON has no concept of comments, so there's nothing to carry over. Comments in an input YAML file are simply dropped when converting YAML → JSON, since JSON can't represent them either.
That's correct YAML behavior — a value like 1.4.2 doesn't match YAML's number syntax, so both this tool and standard YAML libraries treat it as a plain string (common for version numbers).
Yes, as long as the file uses standard block-style YAML without anchors, aliases, or multi-document separators, which covers most real-world Compose and Actions files.
No. It implements the subset of YAML used in the overwhelming majority of configuration files. For strict spec compliance in production code, use a dedicated YAML library in your language of choice.