YAML to JSON
Parse YAML documents and optionally expand all documents or merge keys.
Runs in your browser. Nothing is uploaded.
Parse YAML into structured JSON
YAML to JSON reads a YAML document with a parser and formats the resulting value as JSON with two-space indentation. It handles the common mapping and sequence shapes used in configuration files, while keeping the output as a normal JSON document that other tools can inspect. Paste YAML, use the sample, or drop a .yaml or .yml file into the input area.
This page performs a real parse rather than replacing indentation with braces. That matters for quoted strings, multiline values, nested arrays, and escaped characters. If you need to go back to YAML after editing the result, use JSON to YAML.
YAML features and data types
YAML can include comments, anchors, aliases, quoted and unquoted scalars, and several ways to write a multiline value. The parser turns the supported source into data before JSON is written. Comments are authoring notes, not JSON values, so they do not appear in the output. Anchors and aliases can also change shape when they become ordinary JSON values.
Be deliberate with unquoted values. YAML has scalar rules that may interpret a word as a boolean, a number, null, or another special value. Quote identifiers, version strings, and values with leading zeros when they must remain text. The output is syntactically valid JSON, but it does not validate your application's required fields.
Invalid input and parser boundaries
A missing colon, inconsistent indentation, duplicate key, or malformed quoted value can make YAML invalid. The page shows the parser error and clears the old output so an earlier successful result is not mistaken for the current conversion. Empty input is not treated as a meaningful document.
YAML is a language with parser and version differences. If the target application uses a different YAML implementation, run a representative file through that same implementation too. For JSON-specific syntax checks after conversion, open JSON Formatter.
Review the JSON before using it
Inspect arrays, nested objects, scalar types, and keys before downloading converted.json. Conversion does not apply a schema, remove credentials, or repair business data. File reading, parsing, formatting, and downloading stay in your browser, so nothing is uploaded. For a tabular JSON workflow, the related JSON to CSV page can export an array of records after you confirm its shape.
FAQ
Does YAML to JSON send configuration files to a server?
The component reads and parses the YAML with js-yaml in your browser, then serializes the value as JSON. The source and converted value are never uploaded, and TheDevTab never receives them.
Which YAML features are supported?
The parser accepts mappings, sequences, scalar values, quoted strings, multiline values, comments, and anchors or aliases supported by js-yaml's JSON schema. YAML features outside that schema can produce a parse error rather than a partial JSON result.
What happens to YAML comments?
Comments describe the YAML source but are not part of the parsed JSON value. They are therefore absent from the formatted JSON output.
Can YAML values change type?
Yes. js-yaml interprets unquoted scalars using YAML rules, so a value can become a number, boolean, null, or another supported scalar instead of a string.
What does Expand merge keys do?
When enabled, the converter expands a YAML << merge key from one mapping or a sequence of mappings into ordinary JSON properties. Explicit properties in the current mapping override inherited properties.
What happens with multiple YAML documents?
By default, more than one document separated by --- returns an error and asks you to enable All documents. With that option enabled, the output is a JSON array containing the parsed documents.