Convert JSON to YAML and YAML to JSON

Switch config files and data between JSON and YAML in either direction. Paste or open a file, and errors are pointed out as you type.

How to convert JSON to YAML and YAML to JSON

  1. Pick the direction: JSON to YAML or YAML to JSON.
  2. Paste your data into the left box, or click Open File.
  3. Click Copy or Download to save the result.

JSON and YAML in brief

Both formats describe the same kind of data: values, lists and named groups. JSON uses braces, brackets and quote marks, which programs read easily. YAML uses indentation instead, which people find easier to read and edit, and it allows comments. That is why YAML is common for configuration files while JSON is common for APIs.

JSONYAML
{ "name": "web", "port": 8080 }name: web
port: 8080
{ "tags": ["a", "b"] }tags:
  - a
  - b

Common uses

  • Docker Compose and Kubernetes files, which are written in YAML.
  • OpenAPI and Swagger definitions, which tools accept in either format.
  • CI pipelines such as GitHub Actions, where a JSON snippet needs to become YAML.
  • Checking a YAML file: converting it to JSON shows exactly how it is being read.

Things to know

Comments in YAML are not carried into JSON, because JSON has no comments. YAML anchors and aliases are expanded into full values. Indentation in YAML must use spaces, not tabs; if a file will not convert, the message under the boxes shows the line where the problem is.

Your data stays on your device

The conversion runs entirely in your web browser. Nothing you paste or open is sent to a server, so it is safe to use with customer lists, exports and other private data. There is no sign-up and no size limit beyond what your device can handle.

Frequently asked questions

How do I convert JSON to YAML?

Paste the JSON in the left box and the YAML appears on the right. Copy it or download a .yaml file.

Can it convert YAML to JSON?

Yes. Click YAML to JSON above the boxes and paste your YAML.

Are YAML comments kept?

No. JSON cannot hold comments, so they are dropped when converting to JSON.

Is my data uploaded?

No. The conversion runs in your browser and nothing is sent to a server.