YAML to JSON

Converts YAML to JSON: anchors and references are expanded, long numbers and 1.10 keep their exact form, a duplicate key is reported as an error.

Paste YAML or open a file: docker-compose settings, Kubernetes, GitHub Actions. Anchors and aliases are resolved, the merge key "<<" is expanded, and multiple documents separated by "---" are combined into an array.

Which YAML version

Values are read according to YAML 1.2: yes, no, on, and off stay strings, and 0755 is the decimal number 755. PyYAML and Ansible follow YAML 1.1 and will read the same values differently, so the result notes where this happens.

Numbers are not rounded

A number goes into JSON exactly as written in YAML: 1.10 does not turn into 1.1, and a 20-digit identifier keeps every digit.

Errors

A duplicate key in the same object, a tab in indentation, and an unclosed bracket are reported with a line number. A duplicate key is an error under the YAML standard, so the last value is not silently taken.

Rate this tool

Help us get better

Other tools