All tools
Developer utility

JSON to YAML Converter

Convert strict JSON into a YAML 1.2 document with quoted string keys and values. Objects, arrays and scalar roots are all supported.

Conversion runs locally in your browser. Your JSON is not uploaded or saved.

0 B input. Maximum 2 MiB input, 100 nesting levels and 10 MiB output.

Strict JSON only. Duplicate keys, unsafe integer tokens, non-finite numbers and negative zero are rejected. Fractional and exponent numbers use JavaScript precision and may round or normalize. Drafts stay in memory; refreshing clears them.

YAML indentation

How to convert JSON to YAML

  1. Paste strict JSON or choose a UTF-8 .json file, up to 2 MiB.
  2. Choose two or four spaces and select Convert to YAML.
  3. Correct any reported error at its line and column. Your original input is kept.
  4. Copy the selectable result or download converted.yaml as UTF-8 text.

Worked example

JSON {"name":"Alice","enabled":true,"count":2,"missing":null} becomes:

"name": "Alice"
"enabled": true
"count": 2
"missing": null

Conversion and number rules

JSON is a strict data format; YAML can make nested configuration easier to read. This converter produces only mappings with string keys, sequences, strings, finite numbers, booleans and null. All strings and keys are double quoted, so values such as yes, 00123, null and dates remain strings. Escapes preserve multiline text and trailing string newlines. Output uses LF and one final newline; empty strings, empty objects, empty arrays and null stay distinct.

Duplicate keys at any level are rejected with a JSON-pointer-like path (a slash in a key becomes ~1 and a tilde becomes ~0). Integer tokens outside -9007199254740991 to 9007199254740991 are rejected before numeric coercion. Fractional and exponent tokens use JavaScript-number semantics: their spelling can normalize and excess precision can round. For example, 0.1234567890123456789 becomes 0.12345678901234568. Overflow such as 1e400 is rejected. Negative zero, including -0.0 and negative underflow, is rejected rather than silently losing its sign.

Limits and what is not supported

Input is limited to 2 MiB, nesting to 100 container levels and output to 10 MiB. Processing runs in a locally bundled worker; changing the input or indentation discards old results. No partial output is offered when a limit fails. A UTF-8 file byte order mark is removed. Property order follows the parsed source; numeric spellings and source whitespace are not preserved.

This first release converts JSON to YAML only. It does not accept YAML input, JSON5, comments or trailing commas; infer schemas; restore comments; or produce custom tags, anchors, aliases or merge keys. Strict JSON contains no comments to recover. Drafts are kept only in memory; refresh or close the page to clear them.