ToolStudio.es
In your browser1 Free Trial

Convert YAML to JSON

Turn YAML files into JSON and, if there's an indentation or syntax error, find out which line it's on.

Free try: process 1 document (pasted or 1 file) and change the options as often as you like. Errors do not use up your try.
Input · YAML

Everything runs in your browser: your data is never sent to a server.

Result · JSON
Indentation

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

  1. Paste the YAML or open a .yaml or .yml file.
  2. Pick the JSON indentation.
  3. Click “Convert to JSON”.
  4. 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.

Related tools

Development

JSON to YAML Converter

Convert JSON to YAML with 2 or 4 space indentation. Quotes are added only where needed, so “28001” or “yes” stay text, and key order is kept.

JSONYAML
Try this tool
Development

JSON Validator

Validate JSON against the RFC 8259 standard with every error explained in plain words: trailing commas, single quotes, unquoted keys or comments. It also flags duplicate keys.

JSON
Try this tool
Development

JSON Formatter

Paste minified or messy JSON and get it back indented with 2 or 4 spaces or tabs, with sorted keys if you want. Any error is shown with its line and column.

JSON
Try this tool
Development

XML to JSON Converter

Convert XML to JSON: attributes become “@name”, repeated elements become lists and text becomes values. If the XML is not well formed, it shows the line of the error.

XMLJSONRSS
Try this tool
Featured on TinyShelf