Search tools

YAML to JSON

Convert YAML to JSON, safely, with errors shown by line.

Data

Convert

A safe reading

  • Data only: Custom tags that would run code in some YAML libraries, such as !!python or !!js, are refused, not executed.
  • Aliases limited: Anchors and aliases are expanded, up to 100 of them, so a small file cannot grow into a huge one.
  • One document: A file with several documents (separated by ---) is refused; split it first.
  • What JSON cannot hold: Infinity and NaN are refused, and numbers become JSON numbers: 1.10 in YAML is the number 1.1 in JSON. Quote values in the YAML that must stay text.

Frequently asked questions

Why did my version number 1.10 become 1.1?

In YAML an unquoted 1.10 is a number, and as a number it equals 1.1. Write "1.10" in quotes to keep it as text.

Which YAML version is read?

YAML 1.2, the core schema: yes and no stay strings, true and false are booleans.