Convert in either direction
Select JSON to YAML for readable configuration, or YAML to JSON for API payloads and tooling. The converter handles one document, writes two-space JSON/YAML output, and processes text locally in your browser. Comments and original whitespace are not preserved.
- Choose a direction and paste one document.
- Select Convert and review the result and data types.
- Copy or download the converted text.
Keep strings distinct from numbers and booleans
Quote identifiers and values that should stay text. For example, JSON values "00123" and "true" remain strings through YAML and back. A quoted large ID such as "9007199254740993" avoids number precision loss. Unquoted large integers are rejected.
YAML 1.2 core treats yes, no, on, and off as strings. Dates such as 2024-01-01 also stay strings. JSON decimals use JavaScript Number precision; arbitrary-precision decimal values are not supported.
Supported YAML subset
V1 accepts a single YAML 1.2 document with string mapping keys and JSON-compatible null, boolean, finite number, string, list, and mapping values. Anchors, aliases, merge keys, custom or explicit tags, non-string keys, duplicate keys, YAML 1.1 directives, and multiple documents are rejected. Nested values remain nested.
A small API settings example:
service: api
retry:
enabled: true
ports: [80, 443]
labels:
account: "00123"
flag: "true"Frequently asked questions
Are YAML comments preserved?
No. Conversion reads the data and writes fresh output; comments and source formatting are not retained.
Why does yes stay a string?
This converter uses YAML 1.2 core rules. Only recognized YAML 1.2 boolean words become booleans; yes/no/on/off remain strings.
Are anchors and custom tags supported?
No. Anchors, aliases, merge keys, explicit tags, and custom tags are outside this JSON-compatible subset.
Can I convert multiple YAML documents?
No. Enter one YAML document at a time. A document separator that begins a second document is rejected.
Related developer tools
Validate JSON with JSONLint, compare JSON documents with JSON Diff, or browse Developer Tools.