How to convert YAML to JSON
Convert a document
- Paste a complete YAML document.
- Choose two- or four-space JSON indentation.
- Select Convert to JSON and fix any error with its line and column.
- Review the result, then copy it or download yaml-output.json.
Conversion and safety rules
Mappings become JSON objects, sequences become arrays, and ordinary strings, finite numbers, booleans and null keep their JSON equivalents.
Duplicate mapping keys stop conversion instead of overwriting an earlier value. Multiple YAML documents are rejected because one JSON result cannot preserve document boundaries.
Explicit tags and aliases are rejected. That prevents application-specific object construction, shared references and cycles that JSON cannot represent. Safe integers are emitted as JSON numbers; oversized integers, NaN and infinity are rejected.
Examples
name: mouse active: true items: - cheese - crackers becomes an object containing a Boolean and a JSON array.
A second name key, a --- second document, !!custom tags or *alias references produce a specific error rather than partial output.
Limits
- The input limit is measured as stored UTF-16 characters before parsing. Output is produced only after the whole document passes validation.
- This page does not convert JSON back to YAML, fetch URLs, resolve custom schemas or preserve YAML comments and presentation style.
YAML to JSON FAQ
Why reject aliases?
JSON has no shared-reference or alias syntax. Expanding aliases can also create very large or circular structures, so this focused converter refuses them.
Why reject duplicate keys?
JSON consumers disagree about which duplicate wins. Stopping avoids a silent change of meaning.
Are dates converted automatically?
No custom date conversion is promised. Ordinary core-schema strings remain strings, and explicit tags are rejected.
Is the YAML uploaded?
No. Parsing, copying and file creation happen in this browser.