YAML to JSON

Turn YAML into JSON, with anchors, merge keys and several documents handled

  • Runs in your browser
  • Free
  • No sign-up
Loading YAML to JSON…

How to use it

  1. Paste your YAML into the box, or press Open file.
  2. Read the JSON, or change the indent.
  3. Copy it or download it.

Questions

Are anchors and merge keys expanded?

Yes. A value written with &name and used with *name appears in full wherever it is used, and << merges a map into another, as Docker Compose and many CI files expect.

What if the file has several documents?

Documents separated by --- become a JSON list with one item for each. The message above the result says so.

Which YAML version is read?

YAML 1.2, the current one. In it yes, no, on and off are plain text, not true and false, and 2024-03-31 is text, not a date. Older tools that follow YAML 1.1 read them differently.

Do large numbers keep their digits?

Whole numbers beyond what a JavaScript number can hold exactly are written with all their digits. Decimals have about 15 to 17 digits of precision, as in any JSON tool.

What happens to .inf and .nan?

JSON has no infinity and no not-a-number, so those values become null, and the message above the result says how many.

What about tags such as !!timestamp and !!binary?

A value tagged !!timestamp becomes text in ISO form (2024-03-31T10:00:00.000Z) and !!binary data becomes base64 text. A tag the converter does not know leaves the value as text, and the message above the result names the tag.

Is my data uploaded anywhere?

No. The conversion runs in your browser. Your text is not sent to a server.

Is my text sent to a server?

No. Everything happens in your browser. Your text is not uploaded or stored.

Is it free?

Yes, you can use it for free. A subscription removes limits and unlocks premium tools.