Loona Automation logoLoona Developer Tools
Home › Developer Tools › YAML to JSON Converter

YAML ⇄ JSON Converter - For Everyday Config Files

In short: the YAML ⇄ JSON Converter translates the YAML subset that covers almost every real config file - key: value pairs, nested maps by indentation, lists with dashes, and string, number, boolean and null scalars - in both directions, and tells you plainly what it does not support.

Config files live in YAML; APIs and code live in JSON. Paste either one below to get the other - with an honest subset parser that handles the constructs real-world configs actually use.

Private by design: everything in this tool happens 100% in your browser with JavaScript. Your input is never uploaded to a server, never stored and never seen by us - close the tab and everything is gone.

How to use the YAML to JSON Converter

  1. Paste YAML or JSON into the top box.
  2. Click YAML → JSON or JSON → YAML depending on your input.
  3. Review the result - YAML input becomes pretty-printed JSON; JSON input becomes clean block-style YAML.
  4. Copy the result or download it.

How it works

The YAML reader works in two passes: it first normalizes your document into lines with their indentation (stripping comments outside quotes), then recursively parses blocks - a run of lines at the same indent is a list if the lines start with a dash, a map if they carry keys, or a single scalar. Keys with no value on the same line take the deeper-indented block that follows as their value. Scalars are typed the YAML way: quoted text stays a string, true/false become booleans, null and ~ become null, and plain numbers become JSON numbers. The writer in the other direction emits the same subset: two-space indentation, dashes for lists, and quotes only where a string would otherwise be misread.

Worked example

A docker-compose style fragment - a service name, an image, a list of two ports - converts to a JSON object with a nested map and a real array, and converting that JSON straight back returns the same YAML, which is exactly the round-trip the test suite checks.

Frequently Asked Questions

Is this YAML to JSON converter free?

Yes - completely free, with no sign-up, no size limit and no daily cap.

Which YAML features are supported?

The everyday subset: nested maps by indentation, lists with dashes (including lists of maps), quoted and plain scalars, numbers, booleans, null, and comments. This covers the large majority of hand-written config files.

Which YAML features are NOT supported?

Anchors and aliases (&a / *a), multi-line block scalars (| and >), flow style ({a: 1} / [1, 2]), tags, and multi-document files (---) are not parsed. If your file uses them, convert with a full YAML library instead - we would rather say so than produce a wrong conversion.

Does JSON → YAML quote strings?

Only when needed: a string that looks like a number or boolean, is empty, or contains characters such as a colon followed by a space is double-quoted so it reads back as the same string.

Is my data uploaded to a server?

No. Converting happens 100% in your browser. Your config files never leave your device.

Related Developer Tools

Embed this tool on your website — free

Add this tool to your own website or blog — it is completely free, needs no sign-up, and always shows the latest version. Copy the code below and paste it into your page where you want the tool to appear. Keeping the small “Powered by Loona Automation” credit line under the embed helps keep this tool free — but you are free to style or remove it; the tool works either way.