YAML to JSON Converter

Paste your YAML and get JSON instantly — or flip the toggle to convert JSON back to YAML. Everything runs in your browser, nothing is uploaded. Free, no signup.

YAML input
JSON output

What does this tool do?

This is a free online YAML to JSON converter. Paste a YAML document on the left and the equivalent JSON appears on the right as you type. Flip the direction toggle and it works the other way too — JSON to YAML. Because both YAML and JSON describe the same underlying data model (maps, lists, strings, numbers, booleans and null), converting between them is lossless for the data itself.

The conversion runs entirely in your browser. Nothing you paste is sent to a server, so it is safe to use with config files, secrets templates, or anything you would not want to upload. It also means it keeps working offline once the page has loaded.

How to convert YAML to JSON

YAML to JSON conversion rules (and gotchas)

YAML and JSON map onto the same data model, so the conversion is faithful — but a few YAML features have no JSON equivalent. Knowing these keeps the output from surprising you:

Real-world examples

The most common reason developers convert YAML to JSON is to feed a config file written for humans into a tool or API that expects JSON. For example, this Kubernetes manifest:

apiVersion: v1
kind: ConfigMap
metadata:
  name: app-config
data:
  LOG_LEVEL: info
  REPLICAS: "3"

becomes JSON you can post to the Kubernetes API or pipe into a script:

{
  "apiVersion": "v1",
  "kind": "ConfigMap",
  "metadata": { "name": "app-config" },
  "data": { "LOG_LEVEL": "info", "REPLICAS": "3" }
}

The same pattern covers a docker-compose service, a GitHub Actions workflow, or an Ansible playbook — all written in YAML for readability, then converted to JSON when a script, a CI step, or an API needs to read them programmatically.

Convert YAML to JSON in code (Python, JavaScript, CLI)

This page is the zero-install option, but if you need the conversion inside a script the libraries are one-liners:

For a quick one-off, pasting into the box above is faster than reaching for a library — and nothing leaves your machine.

JSON to YAML

Going the other way, this tool produces clean, block-style YAML: two-space indentation, no unnecessary quoting, and arrays as dash lists. That makes it handy for turning an API response or a package.json snippet into a Kubernetes manifest, a GitHub Actions workflow, or a docker-compose file — formats that are far more pleasant to read and edit as YAML.

YAML vs JSON — which should you use?

JSON is the lingua franca of web APIs: strict, unambiguous, and supported everywhere. It is great for machines but noisy for humans because of all the braces and quotes. YAML is a superset of JSON designed for humans — it drops the punctuation, allows comments, and reads top-to-bottom like an outline. That is why configuration files (Kubernetes, Ansible, CI pipelines, docker-compose) overwhelmingly use YAML, while data sent over the wire uses JSON. Converting between them lets each side of your workflow use the format that fits.

Common uses

FAQ

Is this YAML to JSON converter free?

Yes. It is completely free, needs no account, and runs entirely in your browser. Your data is never uploaded to a server.

Is my data safe?

Yes. All conversion happens locally in your browser with JavaScript. Nothing you paste leaves your device, so it is safe for sensitive config files and secrets.

Does it work offline?

Yes. Once the page has loaded, the converter runs without a network connection — the YAML parser ships with the page.

Does converting YAML to JSON keep my comments?

No. JSON has no concept of comments, so YAML comment lines (starting with #) are dropped. The data itself is preserved exactly.

Why did my version number 1.0 turn into 1?

Unquoted, 1.0 is read as a number and JSON drops the insignificant zero. Write "1.0" in quotes to keep it a string.

Are yes and no converted to true and false?

No. This converter follows YAML 1.2, where yes/no/on/off are strings. Use true or false for booleans.

Why do I get a parse error?

The most common causes are a tab used for indentation (YAML requires spaces), inconsistent indentation, or a missing colon or quote. The red error message points to the line.

Can I convert JSON back to YAML?

Yes — switch the toggle to JSON → YAML, paste valid JSON, and you get clean YAML out.

Can I convert multiple YAML documents at once?

Convert one document at a time. A single JSON value cannot represent a multi-document YAML stream (documents separated by ---).

Is there a size limit?

There is no fixed limit; you are bounded only by your browser's memory since everything runs locally. Very large files (tens of MB) may feel slow.

More format converters