JSON ↔ YAML Converter
Paste JSON or YAML and get the other format right away. The direction is detected from the first character.
Input
Output
How to use JSON ↔ YAML Converter
- 1Paste JSON or YAML into the input panel, or press Sample. Input that starts with { or [ is read as JSON.
- 2Choose a direction and an indent if you need to. Press Swap to move the result into the input and convert it back.
- 3Press Copy to copy the result, or Download to save it as a .yaml or .json file.
JSON ↔ YAML Converter options
- Direction
- Auto reads input that starts with { or [ as JSON and everything else as YAML. Choose JSON → YAML or YAML → JSON to fix the direction, for example when a YAML document starts with a bracket.
- YAML indent
- 2 spaces (default) or 4 spaces for the YAML that is written.
- JSON indent
- 2 spaces (default) or 4 spaces for the JSON that is written.
YAML 1.2 and the Norway problem
This tool reads YAML with the core schema of YAML 1.2 and reads JSON according to RFC 8259. In YAML 1.1, the plain words yes, no, on, and off were booleans, and so was the country code NO. A list of country codes could quietly turn Norway into false. YAML 1.2 removed that rule. Only true and false are booleans, and a date-like value such as 2026-10-02 is a plain string. A %YAML 1.1 line at the top of the input does not change this.
Many programs still use YAML 1.1 parsers. For that reason, when this tool writes YAML it puts quotes around any string that an older parser could read as a boolean, a number, a date, or null, for example "yes", "NO", and "2026-10-02". Both YAML versions then read the value as a string.
What is kept and what is not
Key order is kept in both directions. Numbers are copied as text, so large integers and trailing zeros survive the round trip. JSON errors are reported with the same line, column, and message as in the JSON formatter.
YAML can express things that JSON cannot. Comments, anchor names, and tags are dropped. Keys always become strings, so the key 1 becomes "1". Multi-line block text becomes a single JSON string with \n line breaks.
JSON ↔ YAML Converter examples
JSON to YAML (defaults: Auto, 2 spaces)
Input
{"name":"ZEKILO","tools":["json","base64"],"port":8080}Output
name: ZEKILO tools: - json - base64 port: 8080
YAML to JSON: NO and yes are strings
A YAML 1.1 parser would read both values as booleans. YAML 1.2 does not.
Input
country: NO enabled: yes
Output
{ "country": "NO", "enabled": "yes" }An alias is replaced by its value
The anchor name x has no place in JSON, so the tool shows a note that it was dropped.
Input
a: &x 1 b: *x
Output
{ "a": 1, "b": 1 }Unclosed bracket
Input
a: [1, 2
Output
Line 1, column 9 · Invalid YAML
Examples use the reference cases this tool is tested against.
JSON ↔ YAML Converter: frequently asked questions
Is my input sent to a server?
No. Your input and the result are processed only in this browser and are not stored. Reloading the page clears them.
Why do NO, yes, and off stay strings?
This tool follows YAML 1.2, where only true and false are booleans. YAML 1.1 also treated yes, no, on, off, y, and n as booleans, which turned the country code NO (Norway) into false. When the tool writes YAML, it puts quotes around such strings so that older YAML 1.1 parsers read them as strings too.
What happens to comments and anchors?
JSON has neither. Comments and anchor names are dropped, and every alias is replaced by the value it points to. The tool shows a note when this happens. An alias that refers to itself is reported as an error.
Are large numbers or decimals changed?
No. Numbers are copied as written in both directions, so 12345678901234567890 and 1.0 come out unchanged. Only notations that JSON does not have, such as 0x1F or +1, are rewritten as decimal numbers, and .inf and .nan become null.
What happens to a file with several YAML documents?
Documents separated by --- become one JSON array, one item per document. A file with a single document is not wrapped in an array.
Related tools
How it works · Standards
- Processed in: this browser (your device). Nothing is sent or stored.
- Standards: YAML 1.2 · RFC 8259
- Engine: yaml 2.9.1 (ISC) · ZEKILO Dev JSON parser (in-house code)
- Merge keys (<<) are a YAML 1.1 feature and are not part of the YAML 1.2 core schema. They are kept as an ordinary key named <<.
- Custom tags such as !mytag are dropped and the value is kept. A sequence or mapping used as a key cannot be written as JSON and is reported as an error.
- If the same key appears twice in JSON, the YAML keeps the last value and the tool shows a note.
- As of 2026.10.03
- Changelog: 2026.10.03 First release