Local browser utility

YAML to JSON

Convert YAML to JSON in your browser: nested mappings, sequences, block scalars and flow collections, with anything outside the subset reported by line.

Booleans follow YAML 1.2, so unquoted no stays the string “no” rather than becoming false. Anything outside the supported subset — anchors, aliases, merge keys, tags — is reported by line rather than guessed at.

Questions About This Tool

Why did my value "no" not become false?

Because this follows YAML 1.2, where only true and false are booleans. YAML 1.1 also treated yes, no, on and off as booleans, which is the origin of the Norway problem. The difference is flagged by line; quoting the value removes all doubt.

Does it support anchors and aliases?

It does not resolve them. A file using an anchor still parses — the anchor labels the block beneath it — but an alias referring to that anchor is left as text and reported with its line number rather than expanded.

What happens to my comments?

They are discarded, because JSON has no comment syntax. This is the main thing lost converting YAML to JSON, and it is worth keeping the YAML source rather than treating the JSON as a replacement.

Can it convert a multi-document file?

Only the first document. JSON has no equivalent of the triple-dash separator, so the rest is left alone and the presence of further documents is reported.

Is JSON really valid YAML?

Yes. YAML 1.2 was defined as a superset of JSON, so any JSON document is also a YAML document. The reverse does not hold, which is why converting this direction is the safe one.

Is my config file sent anywhere?

No. It is parsed by your own browser. That matters more here than on most pages, because config files routinely contain credentials — and you can confirm the absence of any request in the network tab.