From YAML to JSON
YAML is comfortable for writing configuration, but many programs, APIs and validators expect JSON. This tool reads the YAML and writes it out as JSON with the indentation you choose.
It understands anchors and aliases (&base and *base), block and bracketed lists, multi-line strings with | and >, and multiple documents separated by “---”, which come back as a JSON array.
It uses YAML 1.2, so words like “yes”, “no” or “on” stay strings and dates are kept as strings. If the YAML has an error, such as indentation that doesn't line up, you see the line and column so you can fix it.
How to convert YAML to JSON
- Paste the YAML or open a .yaml or .yml file.
- Pick the JSON indentation.
- Click “Convert to JSON”.
- Copy the result or download it as a .json file.
When to use it
- Checking what data a Kubernetes manifest or a docker-compose.yml really contains.
- Finding the indentation error that breaks a YAML file.
- Converting an OpenAPI spec from YAML to JSON.
- Using data you have in YAML from JavaScript or an API.
Frequently Asked Questions
Does it support multiple documents in one file?
Yes. If the YAML has several documents separated by “---”, the result is a JSON array with one item per document.
Why don't “yes” or “no” become true or false?
Because the tool uses YAML 1.2, where only true and false are booleans. In YAML 1.1 (the older version) “yes” and “no” were booleans too, which caused bugs like the one with Norway's country code “NO”.
What does it do with anchors and aliases?
It resolves them: wherever *alias appears, the anchor's content is copied in, because JSON has no references.
Is my data sent to a server?
No. Everything is processed in your browser with JavaScript. The text you paste and the files you open never leave your device, so you can safely work with internal or customer data.
Is it free?
Yes. You can try the tool for free on one document (pasted or a single file) and change the options as often as you like; attempts that end in an error don't use up your free try. For unlimited use and processing several files at once, ToolStudio Pro costs €1.99 a month and includes every tool.