Convert JSON objects and arrays to YAML
Paste valid JSON to generate YAML. For example, {"name":"Alice","roles":["editor"]} becomes a mapping with a name: Alice entry and a roles sequence. Nested objects become indented mappings and arrays become YAML sequences.
The converter parses JSON and uses js-yaml to write the result. The writer adds quotes where its output rules require them. A quoted value can still be the same string as an unquoted value elsewhere.
Check data types before using configuration
JSON does not contain comments, anchors, or custom YAML tags, so this conversion cannot invent those details. If the JSON came from a YAML file, converting it back will not restore its original comments or layout. Large numbers also pass through JavaScript numeric parsing and can lose precision.
Use the YAML to JSON converter for the reverse direction. To generate a Kubernetes resource from form fields, use the Kubernetes YAML generator. To inspect invalid source JSON, use the JSON formatter.
Common questions
- Can this generate Kubernetes YAML from any JSON?
- It converts the JSON structure to YAML but does not add or validate Kubernetes resource fields. Use the Kubernetes YAML generator for supported resource templates.
- Will the YAML keep the original JSON formatting?
- No. The converter writes a new YAML representation. Whitespace and layout change while the parsed values determine the output.