# JSON to YAML Guide

Convert JSON documents to YAML.

- Tool: https://ilham.dev/tools/json-to-yaml/
- Guide URL: https://ilham.dev/guides/json-to-yaml/
- Tool guides index: https://ilham.dev/guides/tools/
- Broader guide: Working With Structured Data (https://ilham.dev/guides/working-with-structured-data/)

## What it does

Convert JSON to YAML, preserving the structure rather than reformatting the text. It is the usual way to move a config between a tool that speaks one and a file that is written in the other.

## Use the tool

Open https://ilham.dev/tools/json-to-yaml/, add the input the tool asks for, run it, and check the output before using it elsewhere.

## Input and output

- Input: text.
- Output: text.
- Category: Formats.

## Privacy and processing
Processing happens locally in your browser. This tool does not upload the input to ilham.dev.

## Questions

### Are comments kept?

JSON has no comments, so converting JSON to YAML cannot invent any. Going the other way, YAML comments are dropped because JSON has nowhere to put them.

### Why does my document fail to convert?

Usually an anchor or a custom tag with no equivalent, or a duplicate key. The error names the position.