YAML to JSON

Parse YAML documents, anchors, and merge keys into JSON.

Tool options

Enter text to get started.

How to use YAML to JSON

  1. Paste or type your input. You can also load the example below.
  2. Adjust the available options. Results update after you finish typing; for very large inputs, select Run.
  3. Review the result, then copy it or download it to your device.

How this tool works

Uses YAML 1.2 core types. Dates and yes/no stay strings. Multiple documents become an array. Comments disappear; cycles and non-finite numbers cannot be represented as JSON and produce errors.

Input and output stay in the current page. Refreshing or closing the page clears them. For very large inputs, use Run to start processing; a task that takes too long is stopped so you can change the input.

Frequently asked questions

Can I convert multiple YAML documents at once?

Yes. Enable Allow multiple documents and separate documents with ---. More than one document becomes a JSON array. Anchors and merge keys are supported, but cyclic aliases cannot be represented in JSON.

Will dates, yes/no, comments, or infinity survive conversion?

YAML 1.2 core types are used, so dates and yes/no remain strings. Comments are discarded. Infinity and NaN cause an error unless quoted as strings because JSON cannot represent those numeric values.