YAML to JSON

Convert YAML configuration files to JSON format.

Convert YAML to JSON. Paste a YAML file, such as a Kubernetes manifest, a Docker Compose file or an OpenAPI spec, and get the same data as indented JSON. Anchors and aliases are expanded, and a file with several documents (separated by ---) becomes a JSON array. If the YAML has an error, you get its line and column instead. Conversion uses js-yaml in your browser.

Common use cases

  • Feed a YAML config to a tool or API that only accepts JSON
  • Convert an OpenAPI or Swagger spec from YAML to JSON
  • Check how YAML values are typed (strings, numbers, booleans)
  • Turn YAML test data into JSON fixtures

How to use

  1. Paste the YAML.
  2. Choose the JSON indent.
  3. Copy or download the JSON.

FAQ

Why did 'no' become false?

Older YAML (version 1.1) treats yes, no, on and off as booleans. js-yaml follows YAML 1.2, where only true and false are booleans, but quote values like 'no' if other tools will read the file.

Are comments kept?

No. JSON has no comments, so YAML comments are dropped.

Can I go back to YAML?

Yes, with the JSON to YAML converter.