Skip to content
toolsdocks

Convert JSON to YAML

Paste JSON and get formatted YAML, with a clear error and line number if the JSON is invalid. This page opens the formatter with YAML and From JSON selected.

Runs on your device

More options in the full YAML and XML formatter and validator.

Loading tool…

How to convert JSON to YAML

  1. Paste JSON or choose a .json file.
  2. Leave the mode on From JSON and the language on YAML (preselected here).
  3. Read the YAML in the output.
  4. Copy it or download converted.yaml.

Worked example

{"name":"Ann","tags":["a","b"]} becomes four lines of YAML: name: Ann, then tags: with the list items - a and - b indented beneath it. The output downloads as converted.yaml.

Formats and limits

InputJSON
OutputYAML
Enginejs-yaml (YAML 1.2) and fast-xml-parser with validator

Limitations

  • Comments and trailing commas are not valid JSON and are reported as errors.
  • Output is block-style YAML; flow style is not offered.
  • Output is limited to 50 MB.

Questions

It reports a JSON error.

Fix the line and column shown. Comments and trailing commas are not valid JSON.

Does the key order change?

No. The YAML follows the JSON order; keys are not sorted.

Are strings such as yes or 123 kept as strings?

Yes. Strings that YAML would read as booleans or numbers are quoted so they stay strings.

Privacy

Runs on your device. Files and text are processed in this browser tab and are not uploaded.

This page opens the YAML and XML formatter and validator ready for this task. See the privacy policy for how toolsdocks handles data.