Developer tool / 05
YAML to JSON Converter
Convert YAML configuration into JSON, with a readable message when the document will not parse.
YAML to JSON Converter: TOEA parses the document with a real YAML parser on its safe schema, so anchors and aliases are expanded and no arbitrary types can be constructed from the file. Runs 100% locally in your browser with zero server file uploads.
- Category
- Developer tools
- Runs
- In your browser
- Cost
- Free · no sign-up
- Availability
- Ready to use
Runs entirely in your browser
Up to 5 MB · nothing is uploaded
Which values become booleans and numbers
This converter reads plain values by YAML's strict JSON rules. Only lowercase true, false, and null become a boolean or null; yes, no, on, True, Null, and ~ stay strings, and so do 0755, 0x1F, and dates such as 2024-01-05. Unquoted decimals do become numbers, which catches version fields: python: 3.10 turns into 3.1. Quote anything that must stay text, as in python: "3.10".
Merge keys and multi-document files
Docker Compose and GitLab CI files often reuse a block with <<: *defaults. Merge keys are applied: the shared keys are copied into the block, and keys written in the block itself win over them, so <<: *defaults followed by retries: 5 keeps every default except retries. A list such as <<: [*base, *extra] merges several blocks, with earlier ones taking priority. Anchors and aliases are expanded in full, so the JSON can be much larger than the YAML when a big block is reused many times.
A file holding several documents separated by ---, as Kubernetes manifests often do, is refused with a message about a single document. Convert each document on its own.
How to use it
- Paste YAML or choose a file.
- Pick an indent width.
- Copy or download the JSON.
Privacy & limitations
The text is converted in your browser and never uploaded, which matters when the file is a config or an export you would rather not hand to a stranger. Only the safe schema is used, so a document cannot instantiate types just by being parsed.
Related tools
Frequently asked questions
Why does YAML need a parser at all?
The specification is large — block scalars, anchors, implicit typing, multiple documents. A pattern-matching subset would mis-read real files rather than fail on them, which is worse.
What happens to anchors and aliases?
They are expanded, because JSON has no way to express a reference. The repeated value appears in full wherever it was aliased.
Why did my YAML fail to parse?
Usually indentation: YAML is whitespace-significant and a tab where spaces are expected is invalid. The error names the line.
Are comments kept?
No. JSON has no comment syntax, so they are dropped.
Free tool · runs in your browser · no account required