Skip to content

JSON to YAML & YAML to JSON Converter

Convert JSON to clean YAML for config files, or YAML from Kubernetes, Compose and CI back to JSON.

Input JSON

YAML Output

About the JSON ⇄ YAML

Convert JSON into clean, human-readable YAML, or swap direction to turn YAML into JSON. Strings that YAML could misinterpret, such as yes, no, on or values with special characters, are safely quoted, and YAML errors are reported with their line and column.

How to use it

  1. Paste JSON to convert it to YAML, or press Swap and paste YAML to convert it to JSON.
  2. The result appears as you type; Swap moves it into the input so you can convert it back.
  3. Use Options for indentation, inline (flow) style, sorted keys or quoted strings (or, for YAML to JSON, indentation and the YAML version), then copy or download the file.

Frequently asked questions

Is all JSON valid YAML?

YAML 1.2 is a superset of JSON, so any JSON document is technically valid YAML. Converting gives you YAML's cleaner indentation-based style.

Why are some strings quoted?

Values like yes, no, on, off or strings with colons could be read as booleans or structure by YAML parsers. Quoting keeps them as plain strings.

Which YAML features does YAML to JSON support?

Block and inline mappings and lists, plain, quoted and multi-line (| and >) strings, comments, anchors and aliases, << merge keys, !!str and other standard tags, and several documents separated by ---, which become an array. CloudFormation tags such as !Ref and !Sub are expanded to their full form.

Is yes a boolean or a string?

In YAML 1.2, the current version, yes, no, on and off are strings and only true and false are booleans. Choose YAML 1.1 under Options to read them as booleans, the way older parsers such as PyYAML do.

Related tools