YAML JSON Workbench

Convert YAML to JSON and back without silently changing what your document said.

100% FreeRuns in your browserBasic
Direction

Up to 2 MiB, 64 levels deep. Nothing leaves your browser.

Worth knowing

  • An integer in this document is larger than JavaScript can hold exactly. Its digits are written through to the JSON unchanged rather than rounded or quoted.
JSON
{
  "name": "Zerdly",
  "enabled": true,
  "answer": "yes",
  "items": [
    1,
    2,
    3
  ],
  "id": 9007199254740993
}

What this converter will not do

  • Round a large integer. 9007199254740993 is one more than JavaScript can hold exactly. Its digits are written through to the JSON unchanged — not rounded to …992, and not quoted, because the document said it was a number.
  • Turn yes into true. Under YAML 1.2 core it is the string "yes". It was a boolean under 1.1, and a converter that still does that has changed your document.
  • Keep the last of a duplicate key. Three lines saying name: is an error, not a value.
  • Drop documents. A multi-document stream is refused until you ask for an array, and then every document appears once.
  • Invent a JSON equivalent. Custom tags, sets, binary, NaN, Infinity, non-string keys and circular aliases are refused by name rather than converted into something that means something else.

Comments and anchors cannot survive a trip through JSON. Converting back gives you the same data, not the same file.

Runs entirely in your browser. Your input is not uploaded or stored.

Tip: Enter any known values to calculate the remaining results.

Designed to run locally in your browser. Tool inputs are not intentionally stored by Zerdly unless stated otherwise.