YAML ↔ JSON Converter

Convert YAML to JSON and JSON to YAML as you type, with clear error messages. Works with Kubernetes, Docker Compose, GitHub Actions and OpenAPI files.

  • Live conversion
  • Runs in your browser
  • No signup

Did this save you some time?

aiml.site costs $20 a year to run and every tool stays free. If it helped, you can buy me a dosa.

Loading…

Need a custom web app?

I built every tool here and take freelance work: fast, focused tools for your business.

Email hello@aiml.site

How to use YAML to JSON Converter

  1. Pick the direction: YAML → JSON or JSON → YAML.

  2. Paste or type your data. The result updates as you type.

  3. Copy the output or download it as a file.

How it works

The converter uses the open-source yaml library, which follows the YAML 1.2 standard. YAML input is parsed into data, anchors and aliases are expanded, and the result is printed as JSON. Files with several documents separated by --- become a JSON array. JSON input is read with the browser's JSON parser and written back as block-style YAML. Under YAML 1.2, words like yes, no and on stay as text instead of turning into true or false, which avoids a common source of config bugs. Nothing is sent to a server.

Why use it

  • Two-way conversion, live
  • Line and column for every error
  • Handles anchors, aliases and multi-document files
  • YAML 1.2, so yes/no stay as text
  • Private: runs in your browser

Questions

Does it work both ways?

Yes. Switch between YAML → JSON and JSON → YAML. Switching moves the current output into the input box, so you can round-trip a file.

What happens to files with several --- documents?

Each YAML document becomes one item in a JSON array, in order.

Are anchors and aliases supported?

Yes. Anchors (&name) and aliases (*name) are expanded into full copies in the JSON output.

Why does yes stay as "yes" and not true?

The tool follows YAML 1.2, where only true and false are booleans. Older YAML 1.1 tools turn yes, no, on and off into booleans, which causes bugs like the country code NO becoming false.

Are comments kept?

No. JSON has no comments, so YAML comments are dropped when converting to JSON.

Is my data sent anywhere?

No. Conversion happens in your browser, which makes it safe for config files that contain internal hostnames or keys. Still, rotate any secret you have pasted into a website you do not control.