About the YAML to JSON Converter
Converting YAML to JSON is usually a step towards something else: feeding a manifest to an API that expects JSON, diffing two documents without whitespace noise, or checking what a YAML parser actually thinks your file says. That last use is the interesting one, because the answer is often not what the author intended.
YAML infers types from unquoted scalars, and the inference is aggressive. Converting to JSON makes the result explicit: you see immediately whether your value became a string, a number, or a boolean, because JSON has no ambiguity about it. A version number written as 1.10 arriving as the number 1.1 is obvious in JSON output and invisible in the YAML source.
Conversion runs in your browser, which matters given that the YAML people most often need to convert is Kubernetes or CI configuration containing internal hostnames and occasionally secrets.
Frequently asked questions
Why did my unquoted value become a boolean?
YAML 1.1 treats a long list of words as booleans, including yes, no, on, and off. The country code NO and the answer no both become false. Norway is the famous casualty. Quote any scalar whose exact text matters, and be aware that different parsers implement different YAML versions, so the same file can convert differently in two tools.
What happens to comments?
They are discarded. Comments are not part of the YAML data model, so a parser never hands them to the converter and there is nothing to emit. Keep the YAML as the source of truth and treat the JSON as a derived artefact — a YAML-to-JSON-to-YAML round trip loses every comment in the file.
How are multi-document YAML files handled?
A YAML file can contain several documents separated by three hyphens, which is routine for Kubernetes manifests. JSON has no equivalent, so the usual conversions are a JSON array of documents or JSON Lines with one document per line. A converter that silently emits only the first document is a common source of a partially applied deployment.
Why is my converted JSON so much longer?
Two reasons. JSON requires quotes on every key and string plus explicit braces and brackets, where YAML uses indentation. And YAML anchors are expanded during parsing, so a block defined once and referenced five times appears five times in the output. The documents are equivalent; only the encoding is more verbose.
Are tab characters allowed in YAML?
Not for indentation — the specification forbids it outright, and parsers reject the file with an error that rarely names tabs as the cause. This is a frequent problem when an editor is configured to insert tabs. Tabs inside a quoted scalar value are fine; it is structural indentation that must be spaces.
Need this managed for you, not just automated?
We're also a hands-on DevOps consultancy — Kubernetes, CI/CD, and cloud infrastructure.