convertCASEpro

MODE

JSON to YAML Converter

Switch configuration between JSON and YAML in either direction.

INPUT
CHARS: 0WORDS: 0LINES: 0
OUTPUT
CHARS: 0WORDS: 0LINES: 0

How the JSON to YAML Converter works

JSON is parsed strictly and written out as YAML with block style mappings and lists, without line wrapping, so long strings stay on one line. In the other direction the YAML is parsed and printed as indented JSON.

YAML features that JSON cannot express, such as comments and anchors, are lost when converting to JSON. Multi document YAML files should be converted one document at a time.

When it is useful

  • •Converting an OpenAPI or Kubernetes manifest between formats.
  • •Moving settings from a JSON config to a YAML based tool.
  • •Checking what a YAML file looks like as plain data.
  • •Producing a readable version of a large JSON payload.

Frequently Asked Questions

Are comments preserved?

No. JSON has no comments, so they are dropped when YAML becomes JSON. Converting JSON to YAML cannot add them either.

Why does YAML sometimes turn strings into numbers?

Unquoted values like 1.0, yes, no and null have special meaning in YAML. The converter quotes strings that would otherwise be misread.

Which indentation should I use?

Two spaces is the convention in Kubernetes and most CI files. YAML forbids tabs for indentation.

Related tools

[ Browse all tools ]