How to use JSON to YAML
- Paste your JSON into the input box.
- Choose 2 or 4 spaces of indentation.
- Read the YAML in the output box; JSON errors show the line and column.
- Click Copy or Download to save data.yaml.
Features
- Objects become key: value pairs, arrays become "- item" lists
- Strings that could be mistaken for other types are quoted automatically
- Choose 2 or 4 spaces of indentation
- Reports the line and column of JSON syntax errors
- Runs in your browser, so the JSON is never uploaded
Supported formats and limits
- Maximum input: 10,000,000 characters
Examples
| Input | Result |
|---|---|
| {"name":"OneVixa","tools":["json","yaml"],"settings":{"free":true,"limit":null}} | name: OneVixa tools: - json - yaml settings: free: true limit: null |
| {"version":"1.10","port":"8080"} | version: "1.10" port: "8080" — Text that looks like a number stays quoted so it remains text. |
Limitations
- JSON has no comments, so the YAML output has none either.
- The output uses YAML 1.2 block style only; flow style such as {a: 1} is not produced.
- Only JSON is accepted as input, not JavaScript object literals.
Learn more
YAML is a human-friendly data format that relies on indentation instead of braces and quotes. It is popular for configuration files, such as container orchestration, CI pipelines and application settings, because it is easier to read and allows comments.
JSON and YAML describe the same kinds of data: mappings (objects), sequences (arrays) and scalars (strings, numbers, booleans and null). YAML 1.2 was designed so that valid JSON is also valid YAML, which makes conversion straightforward. The main care point is scalars: in YAML an unquoted value such as 8080, true or null has a type, so text that merely looks like one of those must be quoted to stay text. This converter does that automatically.
Indentation carries meaning in YAML, so mixing tabs and spaces is not allowed. The output here uses spaces only.
Frequently asked questions
Is every JSON file valid YAML?
In practice yes, because YAML 1.2 is designed as a superset of JSON. This converter writes the more readable block style instead of copying the JSON layout.
Why are some values in quotes?
A string such as "8080" or "true" would be read as a number or boolean if written without quotes, so it stays quoted to keep its type.
Can I convert YAML back to JSON?
Yes, use the YAML to JSON converter.
Is my JSON uploaded?
No. The conversion runs in your browser.
Sources
- RFC 8259, The JavaScript Object Notation (JSON) Data Interchange Format
- YAML Ain’t Markup Language (YAML) version 1.2.2
Last reviewed: September 30, 2026