AnyFormat

00 YAML → JSON

YAML to JSON

Multi-document files handled. Indentation errors get a line number.

01YAML in
02JSON out
03Options 2
  • No upload The conversion runs in this tab. Your file never travels — not to us, and not to the advertising.
  • No sign-up, no email, no daily cap There is no account system to sign up to.
  • No size limit we invented Only your device's memory — about ~2 GB on a desktop browser, ~400 MB on a phone.
  • Turn your Wi-Fi off and convert anyway The conversion needs nothing but this page. Ads will not load without a connection; your file will still convert. That is the whole claim, and it takes five seconds to check.

Paste a YAML file — a Kubernetes manifest, a Compose file, an OpenAPI spec — and get JSON. Runs entirely in this tab, so a config file full of secrets stays on your machine.

Multi-document files

YAML files can hold several documents separated by ---, and Kubernetes manifests almost always do. JSON has no equivalent, so the documents are combined into a top-level array in order, and you are told how many there were. If you needed them separate, split the file on --- first.

Anchors, aliases and merge keys

Anchors (&name) and aliases (*name) are resolved: the referenced content is expanded in place, because JSON has no way to express a reference. Merge keys (<<: *defaults) are applied too. This means the JSON is larger than the YAML, sometimes considerably, and the sharing is gone — two aliases of the same anchor become two independent copies.

Where YAML files usually break

Tabs are the most frequent cause. YAML forbids tab characters for indentation entirely, and an editor set to insert tabs produces a file that looks perfectly aligned and will not parse. When that happens you get the line number and an explicit message rather than a generic failure.

The second most common cause is a missing space after a colon: key:value is a single scalar string, not a mapping. The third is inconsistent indentation between sibling keys.

Other names for this

Also searched as “yml to json”, “convert yaml to json online”.

Questions

My Kubernetes manifest became a JSON array.
That file contains several documents separated by ---. JSON has no multi-document concept, so they are combined into an array in order.
The file will not parse and looks fine to me.
Check for tab characters. YAML forbids them for indentation, and they are invisible. The error message names the line.
Are comments kept?
No. JSON has no syntax for comments, so they are dropped.
Is my data uploaded anywhere?
No. The conversion runs as JavaScript inside this tab. Open your browser's Network panel and convert something — you will see no request carrying your data, because there is no server to send it to. You can also turn your Wi-Fi off and convert anyway.