Converting

YAML to JSON converter

Parse a YAML document and convert its values to indented JSON. Mappings become objects, sequences become arrays, and quoted numeric text stays a string.

YAML

0 chars · 0 words · 0 lines

Get QR code
Copy to clipboard
Save to file

JSON

0 chars · 0 words · 0 lines

Get QR code
Copy to clipboard
Save to file

Convert a YAML document to JSON

Paste one YAML document to convert it. For example, name: Alice and age: 30 on separate lines becomes {"name":"Alice","age":30}, displayed with indentation. YAML mappings become JSON objects and sequences become arrays.

The parser uses js-yaml's default schema. Quote values that must stay strings, such as code: "0012". Unquoted values can resolve to numbers, booleans, null, or dates. Inspect the output types before using it in an API or configuration.

Know which YAML details JSON cannot keep

Comments and presentation details do not appear in JSON. Anchors and aliases are resolved to data rather than preserved as YAML syntax. Unknown custom tags and multiple YAML documents produce an error. Circular alias structures cannot be serialized as JSON.

This is a data conversion, so returning the output through the JSON to YAML converter will not restore the original comments, aliases, or layout. Use the JSON Schema validator if you also need to check supported constraints on the converted values.

Common questions

Are YAML comments included in the JSON?
No. Comments describe the YAML source and do not become JSON data. The converter also writes new formatting.
Can I convert several YAML documents at once?
No. This tool parses one document. Split a YAML stream into individual documents before converting it.
Share

marduc812

SourcePrivacy

© 202620261119_b7bad2b