Developer tools
JSON and YAML data converter
Convert JSON to YAML or YAML to JSON for small nested data under the YAML 1.2 JSON schema, then preview and download the converted output.
Use an explicit JSON or YAML example, edit values and calculate. Native exports and report exports are separate; reloading removes temporary scenarios.
Result
Method:
Values are converted, not comments or original formatting. YAML JSON schema; string keys and bounded trees only. Aliases, custom/non-JSON tags, duplicate keys, multiple documents and unsafe-range numbers refuse. Numbers use JavaScript semantics. Input 2000 and output 3500 UTF16 units; no decimal-spelling or full YAML guarantee.
Decimal results are approximate. Inputs stay in this browser tab.
How it works
YAML1.2 JSON-compatible value conversion; bounded nested values and explicit direction. Values are converted, not comments or original formatting. YAML JSON schema; string keys and bounded trees only. Aliases, custom/non-JSON tags, duplicate keys, multiple documents and unsafe-range numbers refuse. Numbers use JavaScript semantics. Input 2000 and output 3500 UTF16 units; no decimal-spelling or full YAML guarantee.
Worked example
Own nested value example; quoted string 0012 keeps leading zeros.
Worked example
With these example values the calculator gives the result below. You can change any value in the form above.
Inputs
- JSON or JSON-compatible YAML (2000 units)
- {"user":{"name":"Example","enabled":true},"values":[1,null,"0012"]}
- Direction
- JSON → YAML
- Output indentation:2 or 4 spaces
- 2
Result
- Data nodes
- 12
- Exact output JSON part 0
- "user:\n name: \"Example\"\n enabled: true\nvalues:\n - 1\n - null\n - \"0012\"\n"
Frequently asked questions
How do I convert JSON to YAML?
Enter JSON, choose the direction and calculate. Small nested JSON-compatible data converts between JSON and YAML, and you can preview and download the output.
Which YAML version does it use?
YAML 1.2 JSON-compatible values with the YAML JSON schema, string keys and bounded trees only.
Are comments preserved?
No. Values are converted, not comments or original formatting.
What does the converter refuse?
Aliases, custom or non-JSON tags, duplicate keys, multiple documents and unsafe-range numbers.
Is a string like 0012 kept as text?
Yes. In the example, the quoted string 0012 keeps its leading zeros.
What are the size limits?
Input 2000 and output 3500 UTF-16 units, or an optional UTF-8 file of 8 KiB.