YAML to JSON

Paste a config file and get JSON. Anchors are expanded, block strings keep their line breaks, and if something is off you get the parser's own message rather than a blank box.

Configs often hold keys and hostnames — nothing here is sent anywhere.

How to use

  1. Paste the YAML into the first box.
  2. Read the JSON below — it appears as you type.
  3. Press «Copy», or switch the tab to convert back.

Good to know

Where the two formats disagree

YAML has things JSON does not: comments, anchors, dates as values, and the notorious rule that turned «no» into false. Comments are dropped because JSON has nowhere to keep them; everything else is converted to the nearest JSON value. A key written as a number stays a key, since JSON only allows strings there.

Why configs deserve a local tool

A YAML file is usually a config, and configs hold hostnames, bucket names, and often a key someone forgot to move into a secret store. Nothing here is uploaded, so pasting a file from a real deployment does not turn into an incident report.

Frequently asked questions

Are anchors and aliases supported?

Yes. An alias is expanded into the value it points to, because JSON has no way to express a reference. Deliberately abusive files with exploding aliases are rejected rather than allowed to freeze the tab.

What happens to comments?

They are removed. JSON has no comment syntax, and inventing one would produce a file that no parser accepts.

Can it read a multi-document file?

It converts the first document. Files separated by --- are usually Kubernetes manifests, and each one is a separate object anyway.

Is the file sent to a server?

No. Parsing happens entirely in your browser.

Related tools