Skip to content

Free YAML to JSON Converter

Convert YAML configuration files and data to JSON format. Handles nested objects, arrays and all YAML data types. Free, with no sign-up required — everything happens right in your browser, so nothing you enter is sent to a server.

🔄 YAML to JSON Converter

How the YAML to JSON Converter Works

Paste YAML and press Convert. The page uses the open-source js-yaml library, a complete and widely used YAML 1.2 parser, to read your text and returns the data as JSON. It understands nested mappings and lists, quoted and multi-line strings, comments, anchors and aliases, and the standard types: strings, numbers, booleans and null. If the file contains several documents separated by three dashes, the result is a JSON array of them.

YAML relies on indentation, so one wrongly indented line changes the structure or causes an error. Use spaces rather than tabs, which YAML does not allow for indentation, and quote values that could be misread, such as a version number like 3.10 that would otherwise become the number 3.1, or the word no, which some parsers read as false. The library is loaded from a public CDN, while your YAML itself stays in your browser.

Practical Use Cases

  • Convert Docker Compose, Kubernetes or GitHub Actions configuration into JSON for a script or API.
  • Check how a YAML file will be interpreted, including types and nesting.
  • Prepare configuration for a tool that only accepts JSON.
  • Find indentation mistakes by looking at the structure the parser produced.

Tips for Best Results

  • Indent with spaces, never tabs, and keep the same number of spaces for items at the same level. Indentation is part of YAML's syntax.
  • Put quotation marks around values that must stay text, such as version numbers like 3.10, postcodes and strings such as yes, no or on.
  • Convert one file at a time and compare the result with the original structure. Anchors and aliases are expanded in the JSON, which can make it longer.

Frequently Asked Questions

YAML is a human-friendly data format used for configuration in Docker Compose, Kubernetes, GitHub Actions, Ansible and many other tools.
Yes. Nested mappings and lists are converted into nested JSON objects and arrays, including lists of objects.
Many APIs, JavaScript programs and data pipelines accept only JSON. You can keep YAML for people and convert it for machines.
YAML reads an unquoted value like 3.10 as a number, which becomes 3.1. Put it in quotes to keep it as text.
No. The conversion runs in your browser, and your YAML content is not sent anywhere. Only the parsing library is downloaded from a public CDN.